This function is for moving the light in the scene. This needs to be adjusted to keep the light from getting all out of whack. For now, we'll just rely on the reset function if we need it fixed.
| 108 | // from getting all out of whack. For now, we'll just rely on the reset function if we need it |
| 109 | // fixed. |
| 110 | void GuiMaterialPreview::setLightTranslate(S32 modifier, F32 xstep, F32 ystep) |
| 111 | { |
| 112 | F32 _lighttransstep = (modifier & SI_SHIFT ? mLightTransStep : (mLightTransStep*mLightTranMult)); |
| 113 | |
| 114 | Point3F relativeLightDirection = GuiMaterialPreview::mFakeSun->getDirection(); |
| 115 | // May be able to get rid of this. For now, it helps to fix the position of the light if i gets messed up. |
| 116 | if (modifier & SI_PRIMARY_CTRL) |
| 117 | { |
| 118 | relativeLightDirection.x += ( xstep * _lighttransstep * -1 );//need to invert this for some reason. Otherwise, it's backwards. |
| 119 | relativeLightDirection.y += ( ystep * _lighttransstep ); |
| 120 | GuiMaterialPreview::mFakeSun->setDirection(relativeLightDirection); |
| 121 | } |
| 122 | // Default action taken by mouse wheel clicking. |
| 123 | else |
| 124 | { |
| 125 | relativeLightDirection.x += ( xstep * _lighttransstep * -1 ); //need to invert this for some reason. Otherwise, it's backwards. |
| 126 | relativeLightDirection.z += ( ystep * _lighttransstep ); |
| 127 | GuiMaterialPreview::mFakeSun->setDirection(relativeLightDirection); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | // This is for panning the viewport camera. |
| 132 | void GuiMaterialPreview::setTranslate(S32 modifier, F32 xstep, F32 ystep) |
nothing calls this directly
no test coverage detected