| 72 | } |
| 73 | |
| 74 | bool GuiMaterialPreview::onWake() |
| 75 | { |
| 76 | if( !Parent::onWake() ) |
| 77 | return false; |
| 78 | |
| 79 | if (!mFakeSun) |
| 80 | mFakeSun = LightManager::createLightInfo(); |
| 81 | |
| 82 | mFakeSun->setColor( LinearColorF( 1.0f, 1.0f, 1.0f ) ); |
| 83 | mFakeSun->setAmbient( LinearColorF( 0.5f, 0.5f, 0.5f ) ); |
| 84 | mFakeSun->setDirection( VectorF( 0.0f, 0.707f, -0.707f ) ); |
| 85 | mFakeSun->setPosition( mFakeSun->getDirection() * -10000.0f ); |
| 86 | mFakeSun->setRange( 2000000.0f ); |
| 87 | |
| 88 | return true; |
| 89 | } |
| 90 | |
| 91 | // This function allows the viewport's ambient color to be changed. This is exposed to script below. |
| 92 | void GuiMaterialPreview::setAmbientLightColor( F32 r, F32 g, F32 b ) |
nothing calls this directly
no test coverage detected