diff options
Diffstat (limited to 'indra/newview/llmaniprotate.cpp')
-rw-r--r-- | indra/newview/llmaniprotate.cpp | 405 |
1 files changed, 215 insertions, 190 deletions
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 7f37f98568..f95eed44b6 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -95,9 +95,9 @@ LLManipRotate::LLManipRotate( LLToolComposite* composite ) mCenterToCamMag(0.f), mCenterToProfilePlane(), mCenterToProfilePlaneMag(0.f), - mSendUpdateOnMouseUp( FALSE ), - mSmoothRotate( FALSE ), - mCamEdgeOn(FALSE), + mSendUpdateOnMouseUp( false ), + mSmoothRotate( false ), + mCamEdgeOn(false), mManipulatorScales(1.f, 1.f, 1.f, 1.f) { } @@ -120,7 +120,7 @@ void LLManipRotate::render() LLGLEnable gl_blend(GL_BLEND); // You can rotate if you can move - LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE); + LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(true); if( !first_object ) { return; @@ -202,7 +202,7 @@ void LLManipRotate::render() { gGL.color4f( 0.7f, 0.7f, 0.7f, 0.3f ); gGL.diffuseColor4f(0.7f, 0.7f, 0.7f, 0.3f); - gl_circle_2d( 0, 0, mRadiusMeters, CIRCLE_STEPS, TRUE ); + gl_circle_2d( 0, 0, mRadiusMeters, CIRCLE_STEPS, true ); } gGL.flush(); @@ -362,11 +362,11 @@ void LLManipRotate::render() renderXYZ(euler_angles); } -BOOL LLManipRotate::handleMouseDown(S32 x, S32 y, MASK mask) +bool LLManipRotate::handleMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; + bool handled = false; - LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE); + LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(true); if( first_object ) { if( mHighlightedPart != LL_NO_PART ) @@ -379,12 +379,12 @@ BOOL LLManipRotate::handleMouseDown(S32 x, S32 y, MASK mask) } // Assumes that one of the parts of the manipulator was hit. -BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) +bool LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) { - BOOL can_rotate = canAffectSelection(); + bool can_rotate = canAffectSelection(); if (!can_rotate) { - return FALSE; + return false; } highlightManipulators(x, y); @@ -439,12 +439,12 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) mAgentSelfAtAxis = gAgent.getAtAxis(); // no point checking if avatar was selected, just save the value // Route future Mouse messages here preemptively. (Release on mouse up.) - setMouseCapture( TRUE ); - LLSelectMgr::getInstance()->enableSilhouette(FALSE); + setMouseCapture( true ); + LLSelectMgr::getInstance()->enableSilhouette(false); mHelpTextTimer.reset(); sNumTimesHelpTextShown++; - return TRUE; + return true; } @@ -459,7 +459,7 @@ LLVector3 LLManipRotate::findNearestPointOnRing( S32 x, S32 y, const LLVector3& return center + proj_onto_ring * mRadiusMeters; } -BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) +bool LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) { // first, perform normal processing in case this was a quick-click handleHover(x, y, mask); @@ -486,7 +486,7 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) // Might have missed last update due to timing. LLSelectMgr::getInstance()->sendMultipleUpdate( UPD_ROTATION | UPD_POSITION ); - LLSelectMgr::getInstance()->enableSilhouette(TRUE); + LLSelectMgr::getInstance()->enableSilhouette(true); //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); LLSelectMgr::getInstance()->updateSelectionCenter(); @@ -497,14 +497,14 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) } -BOOL LLManipRotate::handleHover(S32 x, S32 y, MASK mask) +bool LLManipRotate::handleHover(S32 x, S32 y, MASK mask) { if( hasMouseCapture() ) { if( mObjectSelection->isEmpty() ) { // Somehow the object got deselected while we were dragging it. - setMouseCapture( FALSE ); + setMouseCapture( false ); } else { @@ -520,11 +520,11 @@ BOOL LLManipRotate::handleHover(S32 x, S32 y, MASK mask) } gViewerWindow->setCursor(UI_CURSOR_TOOLROTATE); - return TRUE; + return true; } -LLVector3 LLManipRotate::projectToSphere( F32 x, F32 y, BOOL* on_sphere ) +LLVector3 LLManipRotate::projectToSphere( F32 x, F32 y, bool* on_sphere ) { F32 z = 0.f; F32 dist_squared = x*x + y*y; @@ -556,6 +556,7 @@ void LLManipRotate::drag( S32 x, S32 y ) BOOL damped = mSmoothRotate; mSmoothRotate = FALSE; + bool gltf_mode = false; for (LLObjectSelection::iterator iter = mObjectSelection->begin(); iter != mObjectSelection->end(); iter++) @@ -569,154 +570,177 @@ void LLManipRotate::drag( S32 x, S32 y ) ((root_object == NULL) || !root_object->isPermanentEnforced()) && (object->isRootEdit() || selectNode->mIndividualSelection)) { - if (!object->isRootEdit()) - { - // child objects should not update if parent is selected - LLViewerObject* editable_root = (LLViewerObject*)object->getParent(); - if (editable_root->isSelected()) - { - // we will be moved properly by our parent, so skip - continue; - } - } - LLQuaternion new_rot = selectNode->mSavedRotation * mRotation; - std::vector<LLVector3>& child_positions = object->mUnselectedChildrenPositions ; - std::vector<LLQuaternion> child_rotations; - if (object->isRootEdit() && selectNode->mIndividualSelection) - { - object->saveUnselectedChildrenRotation(child_rotations) ; - object->saveUnselectedChildrenPosition(child_positions) ; - } + if (selectNode->mSelectedGLTFNode != -1) + { + LLQuaternion new_rot = selectNode->mSavedRotation * mRotation; - if (object->getParent() && object->mDrawable.notNull()) - { - LLQuaternion invParentRotation = object->mDrawable->mXform.getParent()->getWorldRotation(); - invParentRotation.transQuat(); + object->setGLTFNodeRotationAgent(selectNode->mSelectedGLTFNode, new_rot); - object->setRotation(new_rot * invParentRotation, damped); - rebuild(object); - } - else - { - object->setRotation(new_rot, damped); - LLVOAvatar* avatar = object->asAvatar(); - if (avatar && avatar->isSelf() - && LLSelectMgr::getInstance()->mAllowSelectAvatar - && !object->getParent()) + gltf_mode = true; + } + else if (!gltf_mode) + { + if (!object->isRootEdit()) { - // Normal avatars use object's orienttion, but self uses - // separate LLCoordFrame - // See LVOAvatar::updateOrientation() - if (gAgentCamera.getFocusOnAvatar()) + // child objects should not update if parent is selected + LLViewerObject* editable_root = (LLViewerObject*)object->getParent(); + if (editable_root->isSelected()) { - //Don't rotate camera with avatar - gAgentCamera.setFocusOnAvatar(false, false, false); + // we will be moved properly by our parent, so skip + continue; } + } - LLVector3 at_axis = mAgentSelfAtAxis; - at_axis *= mRotation; - at_axis.mV[VZ] = 0.f; - at_axis.normalize(); - gAgent.resetAxes(at_axis); + LLQuaternion new_rot = selectNode->mSavedRotation * mRotation; + std::vector<LLVector3>& child_positions = object->mUnselectedChildrenPositions; + std::vector<LLQuaternion> child_rotations; + if (object->isRootEdit() && selectNode->mIndividualSelection) + { + object->saveUnselectedChildrenRotation(child_rotations); + object->saveUnselectedChildrenPosition(child_positions); } - rebuild(object); - } - // for individually selected roots, we need to counterrotate all the children - if (object->isRootEdit() && selectNode->mIndividualSelection) - { - //RN: must do non-damped updates on these objects so relative rotation appears constant - // instead of having two competing slerps making the child objects appear to "wobble" - object->resetChildrenRotationAndPosition(child_rotations, child_positions) ; - } + if (object->getParent() && object->mDrawable.notNull()) + { + LLQuaternion invParentRotation = object->mDrawable->mXform.getParent()->getWorldRotation(); + invParentRotation.transQuat(); + + object->setRotation(new_rot * invParentRotation, damped); + rebuild(object); + } + else + { + object->setRotation(new_rot, damped); + LLVOAvatar* avatar = object->asAvatar(); + if (avatar && avatar->isSelf() + && LLSelectMgr::getInstance()->mAllowSelectAvatar + && !object->getParent()) + { + // Normal avatars use object's orienttion, but self uses + // separate LLCoordFrame + // See LVOAvatar::updateOrientation() + if (gAgentCamera.getFocusOnAvatar()) + { + //Don't rotate camera with avatar + gAgentCamera.setFocusOnAvatar(false, false, false); + } + + LLVector3 at_axis = mAgentSelfAtAxis; + at_axis *= mRotation; + at_axis.mV[VZ] = 0.f; + at_axis.normalize(); + gAgent.resetAxes(at_axis); + } + rebuild(object); + } + + // for individually selected roots, we need to counterrotate all the children + if (object->isRootEdit() && selectNode->mIndividualSelection) + { + //RN: must do non-damped updates on these objects so relative rotation appears constant + // instead of having two competing slerps making the child objects appear to "wobble" + object->resetChildrenRotationAndPosition(child_rotations, child_positions); + } + } } } // update positions - for (LLObjectSelection::iterator iter = mObjectSelection->begin(); - iter != mObjectSelection->end(); iter++) - { - LLSelectNode* selectNode = *iter; - LLViewerObject* object = selectNode->getObject(); - LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); + if (!gltf_mode) + { + for (LLObjectSelection::iterator iter = mObjectSelection->begin(); + iter != mObjectSelection->end(); iter++) + { + LLSelectNode* selectNode = *iter; + LLViewerObject* object = selectNode->getObject(); + LLViewerObject* root_object = (object == NULL) ? NULL : object->getRootEdit(); - // to avoid cumulative position changes we calculate the objects new position using its saved position - if (object && object->permMove() && !object->isPermanentEnforced() && - ((root_object == NULL) || !root_object->isPermanentEnforced())) - { - LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); - - LLVector3 old_position; - LLVector3 new_position; - - if (object->isAttachment() && object->mDrawable.notNull()) - { - // need to work in drawable space to handle selected items from multiple attachments - // (which have no shared frame of reference other than their render positions) - LLXform* parent_xform = object->mDrawable->getXform()->getParent(); - new_position = (selectNode->mSavedPositionLocal * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); - old_position = (object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition();//object->getRenderPosition(); - } - else - { - new_position = gAgent.getPosAgentFromGlobal( selectNode->mSavedPositionGlobal ); - old_position = object->getPositionAgent(); - } - new_position = (new_position - center) * mRotation; // new relative rotated position - new_position += center; - - if (object->isRootEdit() && !object->isAttachment()) - { - LLVector3d new_pos_global = gAgent.getPosGlobalFromAgent(new_position); - new_pos_global = LLWorld::getInstance()->clipToVisibleRegions(selectNode->mSavedPositionGlobal, new_pos_global); - new_position = gAgent.getPosAgentFromGlobal(new_pos_global); - } + // to avoid cumulative position changes we calculate the objects new position using its saved position + if (object && object->permMove() && !object->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced())) + { + LLVector3 center = gAgent.getPosAgentFromGlobal(mRotationCenter); - // for individually selected child objects - if (!object->isRootEdit() && selectNode->mIndividualSelection) - { - LLViewerObject* parentp = (LLViewerObject*)object->getParent(); - if (!parentp->isSelected()) - { - if (object->isAttachment() && object->mDrawable.notNull()) - { - // find position relative to render position of parent - object->setPosition((new_position - parentp->getRenderPosition()) * ~parentp->getRenderRotation()); - rebuild(object); - } - else - { - object->setPositionParent((new_position - parentp->getPositionAgent()) * ~parentp->getRotationRegion()); - rebuild(object); - } - } - } - else if (object->isRootEdit()) - { - if (object->isAttachment() && object->mDrawable.notNull()) - { - LLXform* parent_xform = object->mDrawable->getXform()->getParent(); - object->setPosition((new_position - parent_xform->getWorldPosition()) * ~parent_xform->getWorldRotation()); - rebuild(object); - } - else - { - object->setPositionAgent(new_position); - rebuild(object); - } - } + LLVector3 old_position; + LLVector3 new_position; - // for individually selected roots, we need to counter-translate all unselected children - if (object->isRootEdit() && selectNode->mIndividualSelection) - { - // only offset by parent's translation as we've already countered parent's rotation - rebuild(object); - object->resetChildrenPosition(old_position - new_position) ; - } - } - } + if (selectNode->mSelectedGLTFNode != -1) + { + + } + else + { + if (object->isAttachment() && object->mDrawable.notNull()) + { + // need to work in drawable space to handle selected items from multiple attachments + // (which have no shared frame of reference other than their render positions) + LLXform* parent_xform = object->mDrawable->getXform()->getParent(); + new_position = (selectNode->mSavedPositionLocal * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); + old_position = (object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition();//object->getRenderPosition(); + } + else + { + new_position = gAgent.getPosAgentFromGlobal(selectNode->mSavedPositionGlobal); + old_position = object->getPositionAgent(); + } + + new_position = (new_position - center) * mRotation; // new relative rotated position + new_position += center; + + if (object->isRootEdit() && !object->isAttachment()) + { + LLVector3d new_pos_global = gAgent.getPosGlobalFromAgent(new_position); + new_pos_global = LLWorld::getInstance()->clipToVisibleRegions(selectNode->mSavedPositionGlobal, new_pos_global); + new_position = gAgent.getPosAgentFromGlobal(new_pos_global); + } + + // for individually selected child objects + if (!object->isRootEdit() && selectNode->mIndividualSelection) + { + LLViewerObject* parentp = (LLViewerObject*)object->getParent(); + if (!parentp->isSelected()) + { + if (object->isAttachment() && object->mDrawable.notNull()) + { + // find position relative to render position of parent + object->setPosition((new_position - parentp->getRenderPosition()) * ~parentp->getRenderRotation()); + rebuild(object); + } + else + { + object->setPositionParent((new_position - parentp->getPositionAgent()) * ~parentp->getRotationRegion()); + rebuild(object); + } + } + } + else if (object->isRootEdit()) + { + if (object->isAttachment() && object->mDrawable.notNull()) + { + LLXform* parent_xform = object->mDrawable->getXform()->getParent(); + object->setPosition((new_position - parent_xform->getWorldPosition()) * ~parent_xform->getWorldRotation()); + rebuild(object); + } + else + { + object->setPositionAgent(new_position); + rebuild(object); + } + } + + // for individually selected roots, we need to counter-translate all unselected children + if (object->isRootEdit() && selectNode->mIndividualSelection) + { + // only offset by parent's translation as we've already countered parent's rotation + rebuild(object); + object->resetChildrenPosition(old_position - new_position); + } + } + } + } + } // store changes to override updates for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); @@ -725,12 +749,13 @@ void LLManipRotate::drag( S32 x, S32 y ) LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); LLViewerObject *root_object = (cur == NULL) ? NULL : cur->getRootEdit(); - if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && + + if( cur->permModify() && cur->permMove() && !cur->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && (!cur->isAvatar() || LLSelectMgr::getInstance()->mAllowSelectAvatar)) { - selectNode->mLastRotation = cur->getRotation(); - selectNode->mLastPositionLocal = cur->getPosition(); + selectNode->mLastRotation = cur->getRotation(); + selectNode->mLastPositionLocal = cur->getPosition(); } } @@ -745,13 +770,13 @@ void LLManipRotate::renderActiveRing( F32 radius, F32 width, const LLColor4& fro { LLGLEnable cull_face(GL_CULL_FACE); { - gl_ring(radius, width, back_color, back_color * 0.5f, CIRCLE_STEPS, FALSE); - gl_ring(radius, width, back_color, back_color * 0.5f, CIRCLE_STEPS, TRUE); + gl_ring(radius, width, back_color, back_color * 0.5f, CIRCLE_STEPS, false); + gl_ring(radius, width, back_color, back_color * 0.5f, CIRCLE_STEPS, true); } { LLGLDepthTest gls_depth(GL_FALSE); - gl_ring(radius, width, front_color, front_color * 0.5f, CIRCLE_STEPS, FALSE); - gl_ring(radius, width, front_color, front_color * 0.5f, CIRCLE_STEPS, TRUE); + gl_ring(radius, width, front_color, front_color * 0.5f, CIRCLE_STEPS, false); + gl_ring(radius, width, front_color, front_color * 0.5f, CIRCLE_STEPS, true); } } @@ -786,7 +811,7 @@ void LLManipRotate::renderSnapGuides() LLVector3 world_snap_axis; LLVector3 test_axis = constraint_axis; - BOOL constrain_to_ref_object = FALSE; + bool constrain_to_ref_object = false; if (mObjectSelection->getSelectType() == SELECT_TYPE_ATTACHMENT && isAgentAvatarValid()) { test_axis = test_axis * ~grid_rotation; @@ -794,7 +819,7 @@ void LLManipRotate::renderSnapGuides() else if (LLSelectMgr::getInstance()->getGridMode() == GRID_MODE_REF_OBJECT) { test_axis = test_axis * ~grid_rotation; - constrain_to_ref_object = TRUE; + constrain_to_ref_object = true; } test_axis.abs(); @@ -873,17 +898,17 @@ void LLManipRotate::renderSnapGuides() F32 end_angle = atan2(y_axis_snap * edge_normal, x_axis_snap * edge_normal); //F32 start_angle = angle_between((-1.f * LLVector3::x_axis) * snap_guide_rot, edge_normal); F32 start_angle = end_angle - F_PI; - gl_arc_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, FALSE, start_angle, end_angle); + gl_arc_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, false, start_angle, end_angle); } else { - gl_circle_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, FALSE); + gl_circle_2d(0.f, 0.f, mRadiusMeters * SNAP_GUIDE_INNER_RADIUS, CIRCLE_STEPS, false); } gGL.popMatrix(); for (S32 i = 0; i < 64; i++) { - BOOL render_text = TRUE; + bool render_text = true; F32 deg = 5.625f * (F32)i; LLVector3 inner_point; LLVector3 outer_point; @@ -921,7 +946,7 @@ void LLManipRotate::renderSnapGuides() if (dot > 0.f) { outer_point = inner_point; - render_text = FALSE; + render_text = false; } else { @@ -1060,7 +1085,7 @@ void LLManipRotate::renderSnapGuides() getObjectAxisClosestToMouse(object_axis); // project onto constraint plane - LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(TRUE); + LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(true); object_axis = object_axis * first_node->getObject()->getRenderRotation(); object_axis = object_axis - (object_axis * getConstraintAxis()) * getConstraintAxis(); object_axis.normVec(); @@ -1152,8 +1177,8 @@ void LLManipRotate::renderSnapGuides() } } -// Returns TRUE if center of sphere is visible. Also sets a bunch of member variables that are used later (e.g. mCenterToCam) -BOOL LLManipRotate::updateVisiblity() +// Returns true if center of sphere is visible. Also sets a bunch of member variables that are used later (e.g. mCenterToCam) +bool LLManipRotate::updateVisiblity() { // Don't want to recalculate the center of the selection during a drag. // Due to packet delays, sometimes half the objects in the selection have their @@ -1166,7 +1191,7 @@ BOOL LLManipRotate::updateVisiblity() mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() );//LLSelectMgr::getInstance()->getSelectionCenterGlobal(); } - BOOL visible = FALSE; + bool visible = false; //Assume that UI scale factor is equivalent for X and Y axis F32 ui_scale_factor = LLUI::getScaleFactor().mV[VX]; @@ -1190,7 +1215,7 @@ BOOL LLManipRotate::updateVisiblity() // so use getWorldViewHeightRaw as scale factor when converting to pixel coordinates mCenterScreen.set((S32)((0.5f - center.mV[VY]) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled()), (S32)((center.mV[VZ] + 0.5f) / gAgentCamera.mHUDCurZoom * gViewerWindow->getWorldViewHeightScaled())); - visible = TRUE; + visible = true; } else { @@ -1211,7 +1236,7 @@ BOOL LLManipRotate::updateVisiblity() F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance"); if (dist_vec_squared(gAgent.getPositionAgent(), center) > (max_select_distance * max_select_distance)) { - visible = FALSE; + visible = false; } } @@ -1227,16 +1252,16 @@ BOOL LLManipRotate::updateVisiblity() } else { - visible = FALSE; + visible = false; } } } - mCamEdgeOn = FALSE; + mCamEdgeOn = false; F32 axis_onto_cam = mManipPart >= LL_ROT_X ? llabs( getConstraintAxis() * mCenterToCamNorm ) : 0.f; if( axis_onto_cam < AXIS_ONTO_CAM_TOLERANCE ) { - mCamEdgeOn = TRUE; + mCamEdgeOn = true; } return visible; @@ -1329,7 +1354,7 @@ LLVector3 LLManipRotate::getConstraintAxis() LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); - LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(TRUE); + LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(true); if (first_node) { // *FIX: get agent local attachment grid working @@ -1343,7 +1368,7 @@ LLVector3 LLManipRotate::getConstraintAxis() LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) { - LLSelectNode* first_object_node = mObjectSelection->getFirstMoveableNode(TRUE); + LLSelectNode* first_object_node = mObjectSelection->getFirstMoveableNode(true); LLVector3 constraint_axis = getConstraintAxis(); LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); @@ -1417,7 +1442,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) } LLVector3 projected_mouse; - BOOL hit = getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, constraint_axis); + bool hit = getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, constraint_axis); projected_mouse -= snap_plane_center; if (gSavedSettings.getBOOL("SnapEnabled")) { @@ -1532,9 +1557,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) if (!mInSnapRegime) { - mSmoothRotate = TRUE; + mSmoothRotate = true; } - mInSnapRegime = TRUE; + mInSnapRegime = true; // 0 to 360 deg F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); @@ -1566,17 +1591,17 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) { if (mInSnapRegime) { - mSmoothRotate = TRUE; + mSmoothRotate = true; } - mInSnapRegime = FALSE; + mInSnapRegime = false; } } else { if (mInSnapRegime) { - mSmoothRotate = TRUE; + mSmoothRotate = true; } - mInSnapRegime = FALSE; + mInSnapRegime = false; } if (!mInSnapRegime) @@ -1618,9 +1643,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) { if (!mInSnapRegime) { - mSmoothRotate = TRUE; + mSmoothRotate = true; } - mInSnapRegime = TRUE; + mInSnapRegime = true; // 0 to 360 deg F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f); @@ -1649,9 +1674,9 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) { if (mInSnapRegime) { - mSmoothRotate = TRUE; + mSmoothRotate = true; } - mInSnapRegime = FALSE; + mInSnapRegime = false; } LLVector3 cross_product = mMouseDown % mMouseCur; @@ -1738,7 +1763,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y ) mHighlightedPart = LL_NO_PART; //LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); - LLViewerObject *first_object = mObjectSelection->getFirstMoveableObject(TRUE); + LLViewerObject *first_object = mObjectSelection->getFirstMoveableObject(true); if (!first_object) { @@ -1873,7 +1898,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y ) S32 LLManipRotate::getObjectAxisClosestToMouse(LLVector3& object_axis) { - LLSelectNode* first_object_node = mObjectSelection->getFirstMoveableNode(TRUE); + LLSelectNode* first_object_node = mObjectSelection->getFirstMoveableNode(true); if (!first_object_node) { @@ -1928,9 +1953,9 @@ S32 LLManipRotate::getObjectAxisClosestToMouse(LLVector3& object_axis) } //virtual -BOOL LLManipRotate::canAffectSelection() +bool LLManipRotate::canAffectSelection() { - BOOL can_rotate = mObjectSelection->getObjectCount() != 0; + bool can_rotate = mObjectSelection->getObjectCount() != 0; if (can_rotate) { struct f : public LLSelectedObjectFunctor |