| 421 | } |
| 422 | |
| 423 | void 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 | |
| 448 | void Sun::_initCorona() |
| 449 | { |
nothing calls this directly
no test coverage detected