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

Method _conformLights

Engine/source/environment/sun.cpp:423–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423void Sun::_conformLights()
424{
425 // Build the light direction from the azimuth and elevation.
426 F32 yaw = mDegToRad(mClampF(mSunAzimuth,0,359));
427 F32 pitch = mDegToRad(mClampF(mSunElevation,-360,+360));
428 VectorF lightDirection;
429 MathUtils::getVectorFromAngles(lightDirection, yaw, pitch);
430 lightDirection.normalize();
431 mLight->setDirection( -lightDirection );
432 mLight->setBrightness( mBrightness );
433
434 // Now make sure the colors are within range.
435 mLightColor.clamp();
436 mLight->setColor( mLightColor );
437 mLightAmbient.clamp();
438 mLight->setAmbient( mLightAmbient );
439
440 // Optimization... disable shadows if the ambient and
441 // directional color are the same.
442 bool castShadows = mLightColor != mLightAmbient && mCastShadows;
443 mLight->setCastShadows( castShadows );
444 mLight->setStaticRefreshFreq(mStaticRefreshFreq);
445 mLight->setDynamicRefreshFreq(mDynamicRefreshFreq);
446}
447
448void Sun::_initCorona()
449{

Callers

nothing calls this directly

Calls 12

mDegToRadFunction · 0.85
mClampFFunction · 0.85
getVectorFromAnglesFunction · 0.85
setBrightnessMethod · 0.80
setAmbientMethod · 0.80
setCastShadowsMethod · 0.80
setStaticRefreshFreqMethod · 0.80
setDynamicRefreshFreqMethod · 0.80
normalizeMethod · 0.45
setDirectionMethod · 0.45
clampMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected