Gizmo
Engine/source/gui/worldEditor/gizmo.h
Public Types
Selection { None = -1 Axis_X = 0 Axis_Y = 1 Axis_Z = 2 Plane_XY = 3 Plane_XZ = 4 Plane_YZ = 5 Centroid = 6 Custom1 = 7 Custom2 = 8 }
Private Types
Parent
Public Friends
class
Protected Attributes
bool
mAxisEnabled [3]
bool
bool
If false, don't render the grid plane even if it is enabled in the profile.
bool
bool
bool
If false, don't render a transparent grid overlay when using the move gizmo.
Size of the move grid along one dimension.
Spacing between grid lines on the move grid.
Protected Static Attributes
A large hard coded distance used to test gizmo axis selection.
Public Functions
Gizmo()
~Gizmo()
bool
collideAxisGizmo(const Gui3DMouseEvent & event)
Returns current object to world transform of the object being manipulated.
bool
isDirty()
on3DMouseDown(const Gui3DMouseEvent & event)
on3DMouseDragged(const Gui3DMouseEvent & event)
on3DMouseMove(const Gui3DMouseEvent & event)
on3DMouseUp(const Gui3DMouseEvent & event)
bool
onAdd()
Called when the object is added to the sim.
renderGizmo(const MatrixF & cameraTransform, F32 camerFOV)
setCentroidHandleHighlight(bool state)
setGridPlaneEnabled(bool value)
Set whether to render the grid plane.
setMoveGridEnabled(bool value)
Set whether to a transparent grid overlay when using the move gizmo.
setMoveGridSize(F32 value)
Set the size of the move grid along one dimension.
setMoveGridSpacing(F32 value)
Set the spacing between grid lines on the move grid.
setProfile(GizmoProfile * profile)
setSelection(Selection sel)
Public Static Functions
Protected Functions
Detailed Description
Public Types
Selection
Enumerator
- None = -1
- Axis_X = 0
- Axis_Y = 1
- Axis_Z = 2
- Plane_XY = 3
- Plane_XZ = 4
- Plane_YZ = 5
- Centroid = 6
- Custom1 = 7
- Custom2 = 8
Private Types
typedef SimObject Parent
Public Friends
Protected Attributes
bool mAxisEnabled [3]
MatrixF mCameraMat
Point3F mCameraPos
GizmoAlignment mCurrentAlignment
GizmoMode mCurrentMode
MatrixF mCurrentTransform
F32 mDeltaAngle
Point3F mDeltaPos
EulerF mDeltaRot
Point3F mDeltaScale
Point3F mDeltaTotalPos
EulerF mDeltaTotalRot
Point3F mDeltaTotalScale
bool mDirty
Point3F mElipseCursorCollidePntSS
Point3F mElipseCursorCollideVecSS
bool mGridPlaneEnabled
If false, don't render the grid plane even if it is enabled in the profile.
bool mHighlightAll
bool mHighlightCentroidHandle
F32 mLastAngle
F32 mLastCameraFOV
Gui3DMouseEvent mLastMouseEvent
MatrixF mLastProjMat
Point3F mLastScale
RectI mLastViewport
MatrixF mLastWorldMat
Point2F mLastWorldToScreenScale
MathUtils::Line mMouseCollideLine
PlaneF mMouseCollidePlane
bool mMouseDown
Point2I mMouseDownPos
Point3F mMouseDownProjPnt
bool mMoveGridEnabled
If false, don't render a transparent grid overlay when using the move gizmo.
F32 mMoveGridSize
Size of the move grid along one dimension.
U32 mMoveGridSpacing
Spacing between grid lines on the move grid.
MatrixF mObjectMat
MatrixF mObjectMatInv
Point3F mOrigin
GizmoProfile * mProfile
Point3F mProjAxisVector [3]
F32 mProjLen
Point3F mProjPnt
EulerF mRot
EulerF mSavedRot
Point3F mSavedScale
MatrixF mSavedTransform
Point3F mScale
Point3F mScaleInfluence
bool mScreenRotateHandleEnabled
S32 mSelectionIdx
F32 mSign
GFXStateBlockRef mSolidStateBlock
GFXStateBlockRef mStateBlock
MatrixF mTransform
bool mUniformHandleEnabled
Protected Static Attributes
F32 smProjectDistance
A large hard coded distance used to test gizmo axis selection.
Public Functions
Gizmo()
~Gizmo()
collideAxisGizmo(const Gui3DMouseEvent & event)
DECLARE_CONOBJECT(Gizmo )
getAlignment()
getDeltaRot()
getDeltaScale()
getDeltaTotalRot()
getDeltaTotalScale()
getMode()
getOffset()
getPosition()
getProfile()
getScale()
getSelection()
getTotalOffset()
getTransform()
Returns current object to world transform of the object being manipulated.
isDirty()
markClean()
on3DMouseDown(const Gui3DMouseEvent & event)
on3DMouseDragged(const Gui3DMouseEvent & event)
on3DMouseMove(const Gui3DMouseEvent & event)
on3DMouseUp(const Gui3DMouseEvent & event)
onAdd()
Reimplemented from: SimObject
onRemove()
Reimplemented from: SimObject
renderGizmo(const MatrixF & cameraTransform, F32 camerFOV)
renderText(const RectI & viewPort, const MatrixF & modelView, const MatrixF & projection)
selectionToAxisVector(Selection axis)
set(const MatrixF & objMat, const Point3F & worldPos, const Point3F & objScale)
setCentroidHandleHighlight(bool state)
setGridPlaneEnabled(bool value)
Set whether to render the grid plane.
setMoveGridEnabled(bool value)
Set whether to a transparent grid overlay when using the move gizmo.
setMoveGridSize(F32 value)
Set the size of the move grid along one dimension.
The total size of the move grid is value * value.
setMoveGridSpacing(F32 value)
Set the spacing between grid lines on the move grid.
setProfile(GizmoProfile * profile)
setSelection(Selection sel)
Public Static Functions
initPersistFields()
Protected Functions
_calcAxisInfo()
_filteredAlignment()
_getProjectionLength(F32 dist)
_renderAxisArrows()
_renderAxisBoxes()
_renderAxisCircles()
_renderAxisText()
_renderPlane()
_renderPrimaryAxis()
_setStateBlock()
_snapFloat(const F32 & val, const F32 & snap)
_snapPoint(const Point3F & pnt)
_updateEnabledAxices()
_updateState(bool collideGizmo)