diff options
Diffstat (limited to 'indra/llprimitive/llmodel.h')
-rw-r--r-- | indra/llprimitive/llmodel.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 657dc31fd2..ae195525ef 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -150,7 +150,7 @@ public: LLModel::PhysicsMesh mPhysicsShapeMesh; }; - LLModel(LLVolumeParams& params, F32 detail); + LLModel(const LLVolumeParams& params, F32 detail); ~LLModel(); bool loadModel(std::istream& is); @@ -165,17 +165,17 @@ public: LLModel* low, LLModel* imposotr, const LLModel::Decomposition& decomp, - BOOL upload_skin, - BOOL upload_joints, - BOOL lock_scale_if_joint_position, - BOOL nowrite = FALSE, - BOOL as_slm = FALSE, + bool upload_skin, + bool upload_joints, + bool lock_scale_if_joint_position, + bool nowrite = false, + bool as_slm = false, int submodel_id = 0); static LLSD writeModelToStream( std::ostream& ostr, LLSD& mdl, - BOOL nowrite = FALSE, BOOL as_slm = FALSE); + bool nowrite = false, bool as_slm = false); void ClearFacesAndMaterials() { mVolumeFaces.clear(); mMaterialList.clear(); } @@ -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] @@ -374,7 +375,7 @@ public: LLMatrix4 mTransform; material_map mMaterial; - LLModelInstanceBase(LLModel* model, LLMatrix4& transform, material_map& materials) + LLModelInstanceBase(LLModel* model, const LLMatrix4& transform, const material_map& materials) : mModel(model), mTransform(transform), mMaterial(materials) { } @@ -403,7 +404,7 @@ public: LLUUID mMeshID; S32 mLocalMeshID; - LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, material_map& materials) + LLModelInstance(LLModel* model, const std::string& label, const LLMatrix4& transform, const material_map& materials) : LLModelInstanceBase(model, transform, materials), mLabel(label) { mLocalMeshID = -1; |