LLManipRotate Class Reference

#include <llmaniprotate.h>

Inheritance diagram for LLManipRotate:

Inheritance graph
[legend]
Collaboration diagram for LLManipRotate:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLManipRotate (LLToolComposite *composite)
virtual BOOL handleMouseDown (S32 x, S32 y, MASK mask)
virtual BOOL handleMouseUp (S32 x, S32 y, MASK mask)
virtual BOOL handleHover (S32 x, S32 y, MASK mask)
virtual void render ()
virtual void handleSelect ()
virtual void handleDeselect ()
virtual BOOL handleMouseDownOnPart (S32 x, S32 y, MASK mask)
virtual void highlightManipulators (S32 x, S32 y)
virtual BOOL canAffectSelection ()

Private Member Functions

void updateHoverView ()
void drag (S32 x, S32 y)
LLVector3 projectToSphere (F32 x, F32 y, BOOL *on_sphere)
void renderSnapGuides ()
void renderActiveRing (F32 radius, F32 width, const LLColor4 &center_color, const LLColor4 &side_color)
BOOL updateVisiblity ()
LLVector3 findNearestPointOnRing (S32 x, S32 y, const LLVector3 &center, const LLVector3 &axis)
LLQuaternion dragUnconstrained (S32 x, S32 y)
LLQuaternion dragConstrained (S32 x, S32 y)
LLVector3 getConstraintAxis ()
S32 getObjectAxisClosestToMouse (LLVector3 &axis)

Static Private Member Functions

static void mouseToRay (S32 x, S32 y, LLVector3 *ray_pt, LLVector3 *ray_dir)
static LLVector3 intersectMouseWithSphere (S32 x, S32 y, const LLVector3 &sphere_center, F32 sphere_radius)
static LLVector3 intersectRayWithSphere (const LLVector3 &ray_pt, const LLVector3 &ray_dir, const LLVector3 &sphere_center, F32 sphere_radius)

Private Attributes

LLVector3d mRotationCenter
LLCoordGL mCenterScreen
LLQuaternion mRotation
LLVector3 mMouseDown
LLVector3 mMouseCur
F32 mRadiusMeters
LLVector3 mCenterToCam
LLVector3 mCenterToCamNorm
F32 mCenterToCamMag
LLVector3 mCenterToProfilePlane
F32 mCenterToProfilePlaneMag
EManipPart mManipPart
BOOL mSendUpdateOnMouseUp
BOOL mSmoothRotate
BOOL mCamEdgeOn
LLVector4 mManipulatorVertices [6]
LLVector4 mManipulatorScales

Classes

class  ManipulatorHandle

Detailed Description

Definition at line 46 of file llmaniprotate.h.


Constructor & Destructor Documentation

LLManipRotate::LLManipRotate ( LLToolComposite composite  ) 

Definition at line 89 of file llmaniprotate.cpp.


Member Function Documentation

BOOL LLManipRotate::canAffectSelection (  )  [virtual]

Implements LLManip.

Definition at line 1869 of file llmaniprotate.cpp.

References f, func, LLControlGroup::getBOOL(), gSavedSettings, and LLManip::mObjectSelection.

Referenced by handleMouseDownOnPart().

void LLManipRotate::drag ( S32  x,
S32  y 
) [private]

Definition at line 519 of file llmaniprotate.cpp.

References LLAgent::clearFocusObject(), LLWorld::clipToVisibleRegions(), dialog_refresh_all(), dragConstrained(), dragUnconstrained(), FALSE, gAgent, LLXform::getParent(), LLAgent::getPosAgentFromGlobal(), LLAgent::getPosGlobalFromAgent(), LLXform::getPosition(), LLViewerObject::getPositionAgent(), LLViewerObject::getPositionEdit(), LLViewerObject::getRenderRotation(), LLXform::getRotation(), LLViewerObject::getRotationEdit(), LLSelectMgr::getSelection(), gSelectMgr, gWorldp, i, LLViewerObject::isAttachment(), LLPrimitive::isAvatar(), LLXform::isRootEdit(), LLManip::LL_ROT_GENERAL, LLViewerObject::mChildList, LLViewerObject::mDrawable, mManipPart, LLManip::mObjectSelection, mRotation, mRotationCenter, mSmoothRotate, LLPointer< Type >::notNull(), LLViewerObject::permModify(), LLViewerObject::permMove(), LLManip::rebuild(), LLViewerObject::setPosition(), LLViewerObject::setPositionAgent(), LLViewerObject::setPositionParent(), LLViewerObject::setRotation(), LLSelectMgr::updateSelectionCenter(), and updateVisiblity().

Referenced by handleHover().

LLQuaternion LLManipRotate::dragConstrained ( S32  x,
S32  y 
) [private]

Definition at line 1293 of file llmaniprotate.cpp.

References LLVector3::abs(), angle, LLQuaternion::DEFAULT, DEG_TO_RAD, dot(), f, F_PI_BY_TWO, FALSE, gAgent, LLAgent::getAvatarObject(), LLControlGroup::getBOOL(), LLAgent::getCameraPositionAgent(), getConstraintAxis(), LLControlGroup::getF32(), LLSelectMgr::getGrid(), LLSelectMgr::getGridMode(), LLManip::getMousePointOnPlaneAgent(), getObjectAxisClosestToMouse(), LLAgent::getPosAgentFromGlobal(), GRID_MODE_REF_OBJECT, gSavedSettings, gSelectMgr, llabs(), llmin(), LLVector3::magVec(), LLVector3::magVecSquared(), mCamEdgeOn, mCenterToCam, mCenterToCamNorm, LLManip::mInSnapRegime, mMouseCur, mMouseDown, LLManip::mObjectSelection, mRadiusMeters, mRotationCenter, LLSelectNode::mSavedRotation, mSmoothRotate, LLVector3::mV, LLVector3::normVec(), projected_vec(), RAD_TO_DEG, S32, SELECT_TYPE_ATTACHMENT, SELECT_TYPE_HUD, LLVector3::setVec(), SNAP_ANGLE_DETENTE, SNAP_ANGLE_INCREMENT, SNAP_GUIDE_INNER_RADIUS, sqrtf, TRUE, VX, VY, VZ, LLVector3::x_axis, LLVector3::y_axis, and LLVector3::z_axis.

Referenced by drag().

LLQuaternion LLManipRotate::dragUnconstrained ( S32  x,
S32  y 
) [private]

Definition at line 1194 of file llmaniprotate.cpp.

References angle, LLQuaternion::DEFAULT, f, F_PI_BY_TWO, gAgent, LLAgent::getCameraPositionAgent(), LLManip::getMousePointOnPlaneAgent(), LLAgent::getPosAgentFromGlobal(), intersectMouseWithSphere(), is_approx_zero(), mCenterScreen, mCenterToCamNorm, mCenterToProfilePlane, mCenterToProfilePlaneMag, mMouseCur, mMouseDown, LLManip::mObjectSelection, mRadiusMeters, mRotationCenter, LLCoord::mX, LLCoord::mY, LLVector3::normVec(), RADIUS_PIXELS, and SELECT_TYPE_HUD.

Referenced by drag().

LLVector3 LLManipRotate::findNearestPointOnRing ( S32  x,
S32  y,
const LLVector3 center,
const LLVector3 axis 
) [private]

Definition at line 443 of file llmaniprotate.cpp.

References LLManip::getMousePointOnPlaneAgent(), mRadiusMeters, and LLVector3::normVec().

Referenced by handleMouseDownOnPart().

LLVector3 LLManipRotate::getConstraintAxis (  )  [private]

Definition at line 1251 of file llmaniprotate.cpp.

References LLSelectMgr::getGrid(), gSelectMgr, LLManip::LL_ROT_ROLL, LLManip::LL_ROT_X, llendl, llerrs, llwarns, mCenterToCamNorm, mManipPart, LLManip::mObjectSelection, LLVector3::mV, S32, and TRUE.

Referenced by dragConstrained(), handleMouseDownOnPart(), renderSnapGuides(), and updateVisiblity().

S32 LLManipRotate::getObjectAxisClosestToMouse ( LLVector3 axis  )  [private]

Definition at line 1812 of file llmaniprotate.cpp.

References LLVector3::abs(), LLVector3::clearVec(), mMouseDown, LLManip::mObjectSelection, LLSelectNode::mSavedRotation, LLVector3::mV, S32, TRUE, VX, VY, VZ, LLVector3::x_axis, LLVector3::x_axis_neg, LLVector3::y_axis, LLVector3::y_axis_neg, LLVector3::z_axis, and LLVector3::z_axis_neg.

Referenced by dragConstrained(), and renderSnapGuides().

void LLManipRotate::handleDeselect (  )  [virtual]

Reimplemented from LLManip.

Definition at line 117 of file llmaniprotate.cpp.

References LLManip::handleDeselect(), LLManip::LL_NO_PART, LLManip::mHighlightedPart, and mManipPart.

BOOL LLManipRotate::handleHover ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLManip.

Definition at line 476 of file llmaniprotate.cpp.

References drag(), FALSE, gViewerWindow, LLTool::hasMouseCapture(), highlightManipulators(), lldebugst, llendl, LLManip::mObjectSelection, LLViewerWindow::setCursor(), LLTool::setMouseCapture(), TRUE, and UI_CURSOR_TOOLROTATE.

Referenced by handleMouseUp().

BOOL LLManipRotate::handleMouseDown ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLTool.

Definition at line 360 of file llmaniprotate.cpp.

References FALSE, gViewerWindow, handleMouseDownOnPart(), LLViewerWindow::lastObjectHit(), LLManip::LL_NO_PART, LLManip::mHighlightedPart, LLManip::mObjectSelection, and TRUE.

BOOL LLManipRotate::handleMouseDownOnPart ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Implements LLManip.

Definition at line 378 of file llmaniprotate.cpp.

References canAffectSelection(), DEG_TO_RAD, LLSelectMgr::enableSilhouette(), f, FALSE, findNearestPointOnRing(), gAgent, getConstraintAxis(), LLManip::getMousePointOnPlaneAgent(), LLManip::getPivotPoint(), LLAgent::getPosAgentFromGlobal(), LLAgent::getPosGlobalFromAgent(), gSelectMgr, highlightManipulators(), intersectMouseWithSphere(), LLManip::LL_ROT_GENERAL, llabs(), LLVector3::magVecSquared(), mCenterToCam, mCenterToCamNorm, LLManip::mHighlightedPart, mManipPart, mMouseCur, mMouseDown, mRadiusMeters, mRotationCenter, LLVector3::normVec(), projected_vec(), S32, LLSelectMgr::saveSelectedObjectTransform(), SELECT_ACTION_TYPE_ROTATE, LLTool::setMouseCapture(), SNAP_GUIDE_INNER_RADIUS, sqrtf, and TRUE.

Referenced by handleMouseDown().

BOOL LLManipRotate::handleMouseUp ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLManip.

Definition at line 454 of file llmaniprotate.cpp.

References LLSelectMgr::enableSilhouette(), gSelectMgr, handleHover(), LLManip::handleMouseUp(), LLTool::hasMouseCapture(), LLManip::LL_NO_PART, mManipPart, LLSelectMgr::saveSelectedObjectTransform(), SELECT_ACTION_TYPE_PICK, LLSelectMgr::sendMultipleUpdate(), TRUE, UPD_POSITION, UPD_ROTATION, and LLSelectMgr::updateSelectionCenter().

void LLManipRotate::handleSelect (  )  [virtual]

Reimplemented from LLManip.

Definition at line 109 of file llmaniprotate.cpp.

References gFloaterTools, gSelectMgr, LLManip::handleSelect(), LLSelectMgr::saveSelectedObjectTransform(), SELECT_ACTION_TYPE_PICK, and LLFloaterTools::setStatusText().

void LLManipRotate::highlightManipulators ( S32  x,
S32  y 
) [virtual]

Implements LLManip.

Definition at line 1673 of file llmaniprotate.cpp.

References f, gAgent, LLSelectMgr::getGrid(), LLManip::getMousePointOnPlaneAgent(), LLAgent::getPosAgentFromGlobal(), LLViewerObject::getRenderRotation(), LLViewerWindow::getWindowHeight(), gSelectMgr, gViewerWindow, LLManip::LL_NO_PART, LLManip::LL_ROT_GENERAL, LLManip::LL_ROT_ROLL, LLManip::LL_ROT_X, LLManip::LL_ROT_Y, LLManip::LL_ROT_Z, llabs(), llmax(), MAX_MANIP_SELECT_DISTANCE, mCenterToCamNorm, LLManip::mHighlightedPart, LLManip::mObjectSelection, mRadiusMeters, mRotationCenter, LLVector3::normVec(), RADIUS_PIXELS, TRUE, WIDTH_PIXELS, LLVector3::x_axis, LLVector3::y_axis, and LLVector3::z_axis.

Referenced by handleHover(), and handleMouseDownOnPart().

LLVector3 LLManipRotate::intersectMouseWithSphere ( S32  x,
S32  y,
const LLVector3 sphere_center,
F32  sphere_radius 
) [static, private]

Definition at line 1611 of file llmaniprotate.cpp.

References intersectRayWithSphere(), and mouseToRay().

Referenced by dragUnconstrained(), and handleMouseDownOnPart().

LLVector3 LLManipRotate::intersectRayWithSphere ( const LLVector3 ray_pt,
const LLVector3 ray_dir,
const LLVector3 sphere_center,
F32  sphere_radius 
) [static, private]

Definition at line 1619 of file llmaniprotate.cpp.

References dot(), f, LLVector3::normVec(), and LLVector3::zero.

Referenced by intersectMouseWithSphere().

void LLManipRotate::mouseToRay ( S32  x,
S32  y,
LLVector3 ray_pt,
LLVector3 ray_dir 
) [static, private]

Definition at line 1654 of file llmaniprotate.cpp.

References f, gAgent, gCamera, LLAgent::getAvatarObject(), LLAgent::getCameraPositionAgent(), LLSelectMgr::getSelection(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), gSelectMgr, gViewerWindow, LLVOAvatar::mHUDCurZoom, LLVector3::normVec(), LLViewerCamera::projectScreenToPosAgent(), and SELECT_TYPE_HUD.

Referenced by intersectMouseWithSphere().

LLVector3 LLManipRotate::projectToSphere ( F32  x,
F32  y,
BOOL on_sphere 
) [private]

Definition at line 503 of file llmaniprotate.cpp.

References SQ_RADIUS, and z.

void LLManipRotate::render (  )  [virtual]

Reimplemented from LLTool.

Definition at line 124 of file llmaniprotate.cpp.

References a, b, c, CIRCLE_STEPS, f, gAgent, LLQuaternion::getAngleAxis(), LLAgent::getAvatarObject(), LLQuaternion::getEulerAngles(), LLSelectMgr::getGrid(), LLCriticalDamp::getInterpolant(), LLAgent::getPosAgentFromGlobal(), LLViewerObject::getRotationEdit(), LLAgent::getUpAxis(), gl_circle_2d(), gl_ring(), gl_washer_2d(), glColor4f, glMultMatrixf, glPopMatrix, glRotatef, glTranslatef, gSelectMgr, i, LLMatrix4::initRows(), left, lerp(), LLManip::LL_NO_PART, LLManip::LL_ROT_ROLL, LLManip::LL_ROT_X, LLManip::LL_ROT_Y, LLManip::LL_ROT_Z, llround(), MANIPULATOR_SCALE_HALF_LIFE, mCenterToCamNorm, mCenterToProfilePlane, LLManip::mHighlightedPart, LLVOAvatar::mHUDCurZoom, mManipPart, mManipulatorScales, LLMatrix4::mMatrix, LLManip::mObjectSelection, mRadiusMeters, mRotationCenter, LLVector4::mV, LLVector3::mV, RAD_TO_DEG, RADIUS_PIXELS, renderActiveRing(), renderSnapGuides(), LLManip::renderXYZ(), S32, SELECT_TYPE_HUD, SELECTED_MANIPULATOR_SCALE, LLColor4::setVec(), TRUE, updateVisiblity(), VW, VX, VY, VZ, WIDTH_PIXELS, x, y, and z.

void LLManipRotate::renderActiveRing ( F32  radius,
F32  width,
const LLColor4 center_color,
const LLColor4 side_color 
) [private]

Definition at line 728 of file llmaniprotate.cpp.

References CIRCLE_STEPS, f, FALSE, gl_ring(), and TRUE.

Referenced by render().

void LLManipRotate::renderSnapGuides (  )  [private]

Definition at line 742 of file llmaniprotate.cpp.

References LLVector3::abs(), CIRCLE_STEPS, DEG_TO_RAD, dot(), f, F_PI, FALSE, gAgent, LLQuaternion::getAngleAxis(), LLAgent::getAvatarObject(), LLControlGroup::getBOOL(), LLAgent::getCameraPositionAgent(), getConstraintAxis(), LLSelectMgr::getGrid(), LLSelectMgr::getGridMode(), LLSelectNode::getObject(), getObjectAxisClosestToMouse(), LLAgent::getPosAgentFromGlobal(), LLViewerObject::getRenderRotation(), gl_arc_2d(), gl_circle_2d(), glBegin, glColor4fv, glEnd, glPopMatrix, glRotatef, glTranslatef, GRID_MODE_REF_OBJECT, gSavedSettings, gSelectMgr, i, mCamEdgeOn, LLManip::mInSnapRegime, LLManip::mObjectSelection, mRadiusMeters, mRotationCenter, LLColor4::mV, LLVector3::mV, LLVector3::normVec(), projected_vec(), RAD_TO_DEG, LLManip::renderTickText(), S32, SELECT_TYPE_ATTACHMENT, SELECT_TYPE_HUD, LLManip::setupSnapGuideRenderPass(), LLVector3::setVec(), LLQuaternion::shortestArc(), SNAP_GUIDE_INNER_RADIUS, SNAP_GUIDE_RADIUS_1, SNAP_GUIDE_RADIUS_2, SNAP_GUIDE_RADIUS_3, SNAP_GUIDE_RADIUS_4, SNAP_GUIDE_RADIUS_5, TRUE, VX, VY, VZ, LLColor4::white, x, LLVector3::x_axis, y, LLVector3::y_axis, z, and LLVector3::z_axis.

Referenced by render().

void LLManipRotate::updateHoverView (  )  [private]

BOOL LLManipRotate::updateVisiblity (  )  [private]

Definition at line 1113 of file llmaniprotate.cpp.

References AXIS_ONTO_CAM_TOLERANCE, dist_vec(), f, FALSE, gAgent, gCamera, LLCoordFrame::getAtAxis(), LLAgent::getAvatarObject(), LLControlGroup::getBOOL(), LLAgent::getCameraPositionAgent(), getConstraintAxis(), LLControlGroup::getF32(), LLManip::getPivotPoint(), LLAgent::getPosAgentFromGlobal(), LLAgent::getPosGlobalFromAgent(), LLAgent::getPositionAgent(), LLCamera::getView(), LLCamera::getViewHeightInPixels(), LLViewerWindow::getWindowHeight(), LLViewerWindow::getWindowWidth(), gSavedSettings, gViewerWindow, LLTool::hasMouseCapture(), LLManip::LL_ROT_X, llabs(), mCamEdgeOn, mCenterScreen, mCenterToCam, mCenterToCamMag, mCenterToCamNorm, mCenterToProfilePlane, mCenterToProfilePlaneMag, LLVector3d::mdV, LLVOAvatar::mHUDCurZoom, mManipPart, LLManip::mObjectSelection, mRadiusMeters, mRotationCenter, LLVector3::normVec(), LLViewerCamera::projectPosAgentToScreen(), RADIUS_PIXELS, S32, SELECT_TYPE_HUD, LLCoord::set(), TRUE, VY, and VZ.

Referenced by drag(), and render().


Member Data Documentation

BOOL LLManipRotate::mCamEdgeOn [private]

Definition at line 117 of file llmaniprotate.h.

Referenced by dragConstrained(), renderSnapGuides(), and updateVisiblity().

LLCoordGL LLManipRotate::mCenterScreen [private]

Definition at line 97 of file llmaniprotate.h.

Referenced by dragUnconstrained(), and updateVisiblity().

LLVector3 LLManipRotate::mCenterToCam [private]

Definition at line 106 of file llmaniprotate.h.

Referenced by dragConstrained(), handleMouseDownOnPart(), and updateVisiblity().

F32 LLManipRotate::mCenterToCamMag [private]

Definition at line 108 of file llmaniprotate.h.

Referenced by updateVisiblity().

LLVector3 LLManipRotate::mCenterToCamNorm [private]

Definition at line 107 of file llmaniprotate.h.

Referenced by dragConstrained(), dragUnconstrained(), getConstraintAxis(), handleMouseDownOnPart(), highlightManipulators(), render(), and updateVisiblity().

LLVector3 LLManipRotate::mCenterToProfilePlane [private]

Definition at line 109 of file llmaniprotate.h.

Referenced by dragUnconstrained(), render(), and updateVisiblity().

F32 LLManipRotate::mCenterToProfilePlaneMag [private]

Definition at line 110 of file llmaniprotate.h.

Referenced by dragUnconstrained(), and updateVisiblity().

EManipPart LLManipRotate::mManipPart [private]

Definition at line 112 of file llmaniprotate.h.

Referenced by drag(), getConstraintAxis(), handleDeselect(), handleMouseDownOnPart(), handleMouseUp(), render(), and updateVisiblity().

LLVector4 LLManipRotate::mManipulatorScales [private]

Definition at line 120 of file llmaniprotate.h.

Referenced by render().

LLVector4 LLManipRotate::mManipulatorVertices[6] [private]

Definition at line 119 of file llmaniprotate.h.

LLVector3 LLManipRotate::mMouseCur [private]

Definition at line 103 of file llmaniprotate.h.

Referenced by dragConstrained(), dragUnconstrained(), and handleMouseDownOnPart().

LLVector3 LLManipRotate::mMouseDown [private]

Definition at line 102 of file llmaniprotate.h.

Referenced by dragConstrained(), dragUnconstrained(), getObjectAxisClosestToMouse(), and handleMouseDownOnPart().

F32 LLManipRotate::mRadiusMeters [private]

Definition at line 104 of file llmaniprotate.h.

Referenced by dragConstrained(), dragUnconstrained(), findNearestPointOnRing(), handleMouseDownOnPart(), highlightManipulators(), render(), renderSnapGuides(), and updateVisiblity().

LLQuaternion LLManipRotate::mRotation [private]

Definition at line 100 of file llmaniprotate.h.

Referenced by drag().

LLVector3d LLManipRotate::mRotationCenter [private]

Definition at line 96 of file llmaniprotate.h.

Referenced by drag(), dragConstrained(), dragUnconstrained(), handleMouseDownOnPart(), highlightManipulators(), render(), renderSnapGuides(), and updateVisiblity().

BOOL LLManipRotate::mSendUpdateOnMouseUp [private]

Definition at line 114 of file llmaniprotate.h.

BOOL LLManipRotate::mSmoothRotate [private]

Definition at line 116 of file llmaniprotate.h.

Referenced by drag(), and dragConstrained().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:29 2010 for Second Life Viewer by  doxygen 1.4.7