summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/llmodel.h')
-rw-r--r--indra/llprimitive/llmodel.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index e874586e94..b9c6c9aa24 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -124,8 +124,8 @@ public:
U32 sizeBytes() const
{
U32 res = sizeof(std::vector<LLVector3>) * 2;
- res += sizeof(LLVector3) * mPositions.size();
- res += sizeof(LLVector3) * mNormals.size();
+ res += sizeof(LLVector3) * static_cast<U32>(mPositions.size());
+ res += sizeof(LLVector3) * static_cast<U32>(mNormals.size());
return res;
}
};
@@ -152,7 +152,7 @@ public:
LLModel::PhysicsMesh mPhysicsShapeMesh;
};
- LLModel(LLVolumeParams& params, F32 detail);
+ LLModel(const LLVolumeParams& params, F32 detail);
~LLModel();
bool loadModel(std::istream& is);
@@ -167,17 +167,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(); }
@@ -258,17 +258,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]
@@ -358,7 +359,7 @@ public:
protected:
LLUUID mDiffuseMapID;
- void* mOpaqueData; // allow refs to viewer/platform-specific structs for each material
+ void* mOpaqueData{ nullptr }; // allow refs to viewer/platform-specific structs for each material
// currently only stores an LLPointer< LLViewerFetchedTexture > > to
// maintain refs to textures associated with each material for free
// ref counting.
@@ -376,7 +377,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)
{
}
@@ -405,7 +406,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;