FIRE-34884: Review changes 1

The const gardener.
master
Angeldark Raymaker 2024-12-04 19:48:50 +00:00
parent 42873ea04c
commit 40d852bf3f
4 changed files with 9 additions and 9 deletions

View File

@ -1454,7 +1454,7 @@ E_RotationStyle FSFloaterPoser::getUiSelectedBoneRotationStyle(const std::string
return ABSOLUTE_ROT;
std::string paramValue = getString(XML_JOINT_DELTAROT_STRING_PREFIX + jointName);
if (strstr(paramValue.c_str(), "true"))
if (paramValue == "true")
return DELTAIC_ROT;
return ABSOLUTE_ROT;
@ -1745,7 +1745,7 @@ void FSFloaterPoser::setSelectedJointsPosition(F32 x, F32 y, F32 z)
}
}
void FSFloaterPoser::setSelectedJointsRotation(LLVector3 absoluteRot, LLVector3 deltaRot)
void FSFloaterPoser::setSelectedJointsRotation(const LLVector3& absoluteRot, const LLVector3& deltaRot)
{
LLVOAvatar *avatar = getUiSelectedAvatar();
if (!avatar)

View File

@ -186,7 +186,7 @@ class FSFloaterPoser : public LLFloater
/// There may be +/- PI difference two axes, because harmonics.
/// Thus keep your UI synced with less gets.
/// </remarks>
void setSelectedJointsRotation(LLVector3 absoluteRot, LLVector3 deltaRot);
void setSelectedJointsRotation(const LLVector3& absoluteRot, const LLVector3& deltaRot);
void setSelectedJointsPosition(F32 x, F32 y, F32 z);
void setSelectedJointsScale(F32 x, F32 y, F32 z);

View File

@ -282,7 +282,7 @@ bool FSPosingMotion::vectorsNotQuiteEqual(LLVector3 v1, LLVector3 v2) const
return true;
}
bool FSPosingMotion::quatsNotQuiteEqual(LLQuaternion q1, LLQuaternion q2) const
bool FSPosingMotion::quatsNotQuiteEqual(const LLQuaternion& q1, const LLQuaternion& q2) const
{
if (vectorAxesAlmostEqual(q1.mQ[VW], q2.mQ[VW]) &&
vectorAxesAlmostEqual(q1.mQ[VX], q2.mQ[VX]) &&

View File

@ -202,12 +202,12 @@ private:
bool vectorsNotQuiteEqual(LLVector3 v1, LLVector3 v2) const;
/// <summary>
/// Determines if two vectors are near enough to equal.
/// Determines if two quaternions are near enough to equal.
/// </summary>
/// <param name="v1">The first vector to compare.</param>
/// <param name="v2">The sceond vector to compare.</param>
/// <returns>true if the vectors are "close enough", otherwise false.</returns>
bool quatsNotQuiteEqual(LLQuaternion q1, LLQuaternion q2) const;
/// <param name="v1">The first quaternion to compare.</param>
/// <param name="v2">The sceond quaternion to compare.</param>
/// <returns>true if the quaternion are "close enough", otherwise false.</returns>
bool quatsNotQuiteEqual(const LLQuaternion& q1, const LLQuaternion& q2) const;
bool vectorAxesAlmostEqual(F32 qA, F32 qB) const { return llabs(qA - qB) < closeEnough; }
};