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

Method resetViewport

Engine/source/T3D/guiMaterialPreview.cpp:433–445  ·  view source on GitHub ↗

This function is meant to be used with a button to put everything back to default settings.

Source from the content-addressed store, hash-verified

431
432// This function is meant to be used with a button to put everything back to default settings.
433void GuiMaterialPreview::resetViewport()
434{
435 // Reset the camera's orientation.
436 mCameraRot.set( mDegToRad(30.0f), 0, mDegToRad(-30.0f) );
437 mCameraPos.set(0.0f, 1.75f, 1.25f);
438 mOrbitDist = 5.0f;
439 mOrbitPos = mModel->getShape()->center;
440
441 // Reset the viewport's lighting.
442 GuiMaterialPreview::mFakeSun->setColor( LinearColorF( 1.0f, 1.0f, 1.0f ) );
443 GuiMaterialPreview::mFakeSun->setAmbient( LinearColorF( 0.5f, 0.5f, 0.5f ) );
444 GuiMaterialPreview::mFakeSun->setDirection( VectorF( 0.0f, 0.707f, -0.707f ) );
445}
446
447// Expose the class and functions to the console.
448IMPLEMENT_CONOBJECT(GuiMaterialPreview);

Callers 1

Calls 7

mDegToRadFunction · 0.85
setAmbientMethod · 0.80
LinearColorFClass · 0.50
setMethod · 0.45
getShapeMethod · 0.45
setColorMethod · 0.45
setDirectionMethod · 0.45

Tested by

no test coverage detected