MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getWorldToLightProj

Method getWorldToLightProj

Engine/source/lighting/lightInfo.cpp:150–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void 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
174void LightInfoList::registerLight( LightInfo *light )
175{

Callers 1

setLightInfoMethod · 0.80

Calls 3

mDegToRadFunction · 0.85
makeProjectionFunction · 0.85
inverseMethod · 0.45

Tested by

no test coverage detected