| 148 | } |
| 149 | |
| 150 | void LightInfo::getWorldToLightProj( MatrixF *outMatrix ) const |
| 151 | { |
| 152 | if ( mType == Spot ) |
| 153 | { |
| 154 | // For spots we need to include the cone projection. |
| 155 | F32 fov = mDegToRad( getOuterConeAngle() ); |
| 156 | F32 range = getRange().x; |
| 157 | MatrixF proj; |
| 158 | MathUtils::makeProjection( &proj, fov, 1.0f, range * 0.01f, range, true ); |
| 159 | |
| 160 | MatrixF light = getTransform(); |
| 161 | light.inverse(); |
| 162 | |
| 163 | *outMatrix = proj * light; |
| 164 | return; |
| 165 | } |
| 166 | else |
| 167 | { |
| 168 | // The other lights just use the light transform. |
| 169 | *outMatrix = getTransform(); |
| 170 | outMatrix->inverse(); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | void LightInfoList::registerLight( LightInfo *light ) |
| 175 | { |
no test coverage detected