summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2024-05-07 09:47:37 -0500
committerGitHub <noreply@github.com>2024-05-07 09:47:37 -0500
commit155ddf23363f1d5c534c69f50505faf67e51948f (patch)
tree976912ed4fa3bc2af7b0b68201460f08614748b5 /indra/llprimitive
parentf79548ec68ebcef8f8f83705b65fd59da43c3e26 (diff)
parentf9473e8afcb624cc1b101195bf15943ec372b56f (diff)
Merge pull request #1421 from secondlife/DRTVWR-600-maint-A
Drtvwr 600 maint a
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmodel.h7
-rw-r--r--indra/llprimitive/llprimitive.h9
-rw-r--r--indra/llprimitive/llvolumemessage.cpp8
3 files changed, 13 insertions, 11 deletions
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 1242646a8a..bcd33ba2db 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -256,17 +256,18 @@ public:
}
};
-
//Are the doubles the same w/in epsilon specified tolerance
bool areEqual( double a, double b )
{
const float epsilon = 1e-5f;
- return (fabs((a - b)) < epsilon) ? true : false ;
+ return fabs(a - b) < epsilon;
}
+
//Make sure that we return false for any values that are within the tolerance for equivalence
bool jointPositionalLookup( const LLVector3& a, const LLVector3& b )
{
- return ( areEqual( a[0],b[0]) && areEqual( a[1],b[1] ) && areEqual( a[2],b[2]) ) ? true : false;
+ const float epsilon = 1e-5f;
+ return (a - b).length() < epsilon;
}
//copy of position array for this model -- mPosition[idx].mV[X,Y,Z]
diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h
index c4fe4fdf62..2b15adb162 100644
--- a/indra/llprimitive/llprimitive.h
+++ b/indra/llprimitive/llprimitive.h
@@ -566,6 +566,7 @@ public:
void addFlags(U32 flags) { mMiscFlags |= flags; }
void removeFlags(U32 flags) { mMiscFlags &= ~flags; }
U32 getFlags() const { return mMiscFlags; }
+ bool checkFlags(U32 flags) const { return (mMiscFlags & flags) != 0; }
static std::string pCodeToString(const LLPCode pcode);
static LLPCode legacyToPCode(const U8 legacy);
@@ -603,21 +604,19 @@ public:
inline bool LLPrimitive::isAvatar() const
{
- return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode ) ? true : false;
+ return LL_PCODE_LEGACY_AVATAR == mPrimitiveCode;
}
inline bool LLPrimitive::isSittingAvatar() const
{
// this is only used server-side
- return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode
- && ((getFlags() & (PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND)) != 0) ) ? true : false;
+ return isAvatar() && checkFlags(PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND);
}
inline bool LLPrimitive::isSittingAvatarOnGround() const
{
// this is only used server-side
- return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode
- && ((getFlags() & PRIM_FLAG_SITTING_ON_GROUND) != 0) ) ? true : false;
+ return isAvatar() && checkFlags(PRIM_FLAG_SITTING_ON_GROUND);
}
// static
diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp
index 8d47a7147f..1b3422ab6d 100644
--- a/indra/llprimitive/llvolumemessage.cpp
+++ b/indra/llprimitive/llvolumemessage.cpp
@@ -478,13 +478,15 @@ bool LLVolumeMessage::constrainVolumeParams(LLVolumeParams& params)
bad |= params.setRevolutions(params.getPathParams().getRevolutions()) ? 0 : 0x200;
bad |= params.setRadiusOffset(params.getPathParams().getRadiusOffset()) ? 0 : 0x400;
bad |= params.setSkew(params.getPathParams().getSkew()) ? 0 : 0x800;
- if(bad)
+
+ if (bad)
{
LL_WARNS() << "LLVolumeMessage::constrainVolumeParams() - "
<< "forced to constrain incoming volume params: "
- << llformat("0x%04x",bad) << LL_ENDL;
+ << llformat("0x%04x", bad) << LL_ENDL;
}
- return bad ? false : true;
+
+ return bad == 0;
}
bool LLVolumeMessage::packVolumeParams(const LLVolumeParams* params, LLMessageSystem *mesgsys)