This function is meant to be used with a button to put everything back to default settings.
| 431 | |
| 432 | // This function is meant to be used with a button to put everything back to default settings. |
| 433 | void 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. |
| 448 | IMPLEMENT_CONOBJECT(GuiMaterialPreview); |
no test coverage detected