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

Method onWake

Engine/source/T3D/guiMaterialPreview.cpp:74–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74bool 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.
92void GuiMaterialPreview::setAmbientLightColor( F32 r, F32 g, F32 b )

Callers

nothing calls this directly

Calls 7

setAmbientMethod · 0.80
LinearColorFClass · 0.50
setColorMethod · 0.45
setDirectionMethod · 0.45
setPositionMethod · 0.45
getDirectionMethod · 0.45
setRangeMethod · 0.45

Tested by

no test coverage detected