diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index f4e16f2ee3..c374bd9d25 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -3823,31 +3823,31 @@ glm::vec3 MyAvatar::calculateScaledDirection() { // Determine if we're head or controller relative... glm::vec3 forward, right; - const int movementReference = getMovementReference(); + int movementReference = getMovementReference(); CameraMode cameraMode = qApp->getCamera().getMode(); bool vectorsAreInAvatarFrame = true; bool removeLocalYComponent = false; - const bool HMDHandRelativeMovement = + bool HMDHandRelativeMovement = qApp->isHMDMode() && (movementReference == LocomotionRelativeMovementMode::MOVEMENT_HAND_RELATIVE || movementReference == LocomotionRelativeMovementMode::MOVEMENT_HAND_RELATIVE_LEVELED); - const bool desktopLookatOrSelfieMode = + bool desktopLookatOrSelfieMode = !qApp->isHMDMode() && (cameraMode == CAMERA_MODE_FIRST_PERSON_LOOK_AT || cameraMode == CAMERA_MODE_LOOK_AT || cameraMode == CAMERA_MODE_SELFIE); - const bool hoveringOrCollisionless = _characterController.getState() == CharacterController::State::Hover || + bool hoveringOrCollisionless = _characterController.getState() == CharacterController::State::Hover || _characterController.computeCollisionMask() == BULLET_COLLISION_MASK_COLLISIONLESS; if (HMDHandRelativeMovement) { - const controller::Action directionHand = + controller::Action directionHand = (getDominantHand() == DOMINANT_RIGHT_HAND) ? controller::Action::LEFT_HAND : controller::Action::RIGHT_HAND; - const controller::Pose handPoseInAvatarFrame = getControllerPoseInAvatarFrame(directionHand); + controller::Pose handPoseInAvatarFrame = getControllerPoseInAvatarFrame(directionHand); if (handPoseInAvatarFrame.isValid()) { - const glm::vec3 controllerForward(0.0f, 1.0f, 0.0f); - const glm::vec3 controllerRight(0.0f, 0.0f, (directionHand == controller::Action::LEFT_HAND) ? 1.0f : -1.0f); + glm::vec3 controllerForward(0.0f, 1.0f, 0.0f); + glm::vec3 controllerRight(0.0f, 0.0f, (directionHand == controller::Action::LEFT_HAND) ? 1.0f : -1.0f); forward = (handPoseInAvatarFrame.rotation * controllerForward); right = (handPoseInAvatarFrame.rotation * controllerRight); @@ -3887,7 +3887,7 @@ glm::vec3 MyAvatar::calculateScaledDirection() { auto removeYAndNormalize = [](glm::vec3& vector) { vector.y = 0.f; // Normalize if the remaining components are large enough to get a reliable direction. - const float length = glm::length(vector); + float length = glm::length(vector); const float MIN_LENGTH_FOR_NORMALIZE = 0.061f; // sin(3.5 degrees) if (length > MIN_LENGTH_FOR_NORMALIZE) { vector /= length; @@ -4843,16 +4843,16 @@ glm::mat4 MyAvatar::deriveBodyFromHMDSensor(const bool forceFollowYPos) const { glm::vec3 headToNeck = headOrientation * Quaternions::Y_180 * (localNeck - localHead); glm::vec3 neckToRoot = headOrientationYawOnly * Quaternions::Y_180 * -localNeck; - const float worldToSensorScale = getUserEyeHeight() / getEyeHeight(); + float worldToSensorScale = getUserEyeHeight() / getEyeHeight(); glm::vec3 bodyPos = headPosition + worldToSensorScale * (headToNeck + neckToRoot); glm::quat bodyQuat; - const controller::Pose hipsControllerPose = getControllerPoseInSensorFrame(controller::Action::HIPS); + controller::Pose hipsControllerPose = getControllerPoseInSensorFrame(controller::Action::HIPS); if (hipsControllerPose.isValid()) { - const glm::quat hipsOrientation = hipsControllerPose.rotation * Quaternions::Y_180; - const glm::quat hipsOrientationYawOnly = cancelOutRollAndPitch(hipsOrientation); + glm::quat hipsOrientation = hipsControllerPose.rotation * Quaternions::Y_180; + glm::quat hipsOrientationYawOnly = cancelOutRollAndPitch(hipsOrientation); - const glm::vec3 hipsPos = hipsControllerPose.getTranslation(); + glm::vec3 hipsPos = hipsControllerPose.getTranslation(); bodyPos.x = hipsPos.x; bodyPos.z = hipsPos.z; @@ -4863,7 +4863,7 @@ glm::mat4 MyAvatar::deriveBodyFromHMDSensor(const bool forceFollowYPos) const { if (!forceFollowYPos && !getHMDCrouchRecenterEnabled()) { // Set the body's vertical position as if it were standing in its T-pose. - const float userToRigScale = getUserEyeHeight() / getUnscaledEyeHeight(); + float userToRigScale = getUserEyeHeight() / getUnscaledEyeHeight(); bodyPos.y = userToRigScale * rig.getUnscaledHipsHeight(); } diff --git a/interface/src/avatar/MySkeletonModel.cpp b/interface/src/avatar/MySkeletonModel.cpp index 2d33ee35ca..7413e4ece7 100755 --- a/interface/src/avatar/MySkeletonModel.cpp +++ b/interface/src/avatar/MySkeletonModel.cpp @@ -65,7 +65,7 @@ static AnimPose computeHipsInSensorFrame(MyAvatar* myAvatar, bool isFlying) { return result; } - const bool useCenterOfGravityModel = + bool useCenterOfGravityModel = myAvatar->getCenterOfGravityModelEnabled() && !isFlying && !myAvatar->getIsInWalkingState() && !myAvatar->getIsInSittingState() && myAvatar->getHMDLeanRecenterEnabled() && (myAvatar->getAllowAvatarLeaningPreference() != MyAvatar::AllowAvatarLeaningPreference::AlwaysNoRecenter) && diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 12615426f1..9c53060f31 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -422,11 +422,11 @@ void setupPreferences() { preferences->addPreference(preference); } { - const IntPreference::Getter getter = [myAvatar]() -> int { + IntPreference::Getter getter = [myAvatar]() -> int { return static_cast(myAvatar->getAllowAvatarStandingPreference()); }; - const IntPreference::Setter setter = [myAvatar](const int& value) { + IntPreference::Setter setter = [myAvatar](const int& value) { myAvatar->setAllowAvatarStandingPreference(static_cast(value)); }; @@ -440,11 +440,11 @@ void setupPreferences() { preferences->addPreference(preference); } { - const IntPreference::Getter getter = [myAvatar]() -> int { + IntPreference::Getter getter = [myAvatar]() -> int { return static_cast(myAvatar->getAllowAvatarLeaningPreference()); }; - const IntPreference::Setter setter = [myAvatar](const int& value) { + IntPreference::Setter setter = [myAvatar](const int& value) { myAvatar->setAllowAvatarLeaningPreference(static_cast(value)); }; diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 8b49334925..6dc378a32f 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -2805,9 +2805,9 @@ float Rig::getUnscaledEyeHeight() const { // Get the vertical position of the hips joint, in the rig coordinate frame, ignoring the avatar scale. float Rig::getUnscaledHipsHeight() const { // This factor can be used to scale distances in the geometry frame into the unscaled rig frame. - const float scaleFactor = GetScaleFactorGeometryToUnscaledRig(); + float scaleFactor = GetScaleFactorGeometryToUnscaledRig(); - const int hipsJoint = indexOfJoint("Hips"); + int hipsJoint = indexOfJoint("Hips"); // Values from the skeleton are in the geometry coordinate frame. if (hipsJoint >= 0) { diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index 04ccd9e547..777a3d3f87 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -370,8 +370,8 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar btVector3 linearDisplacement(0.0f, 0.0f, 0.0f); { - const float horizontalTime = _followTimeRemainingPerType[static_cast(FollowType::Horizontal)]; - const float verticalTime = _followTimeRemainingPerType[static_cast(FollowType::Vertical)]; + float horizontalTime = _followTimeRemainingPerType[static_cast(FollowType::Horizontal)]; + float verticalTime = _followTimeRemainingPerType[static_cast(FollowType::Vertical)]; if (horizontalTime == FOLLOW_TIME_IMMEDIATE_SNAP) { linearDisplacement.setX(deltaPos.x()); @@ -402,7 +402,7 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar // startRot as default rotation btQuaternion endRot = startRot; - const float rotationTime = _followTimeRemainingPerType[static_cast(FollowType::Rotation)]; + float rotationTime = _followTimeRemainingPerType[static_cast(FollowType::Rotation)]; if (rotationTime > MINIMUM_TIME_REMAINING) { btQuaternion desiredRot = _followDesiredBodyTransform.getRotation();