summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-rw-r--r--indra/llprimitive/llmodel.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 6a322bb9ec..e7152a2291 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -101,7 +101,7 @@ void LLModel::offsetMesh( const LLVector3& pivotPoint )
LLVolumeFace& face = *currentFaceIt;
LLVector4a *pos = (LLVector4a*) face.mPositions;
- for (U32 i=0; i<face.mNumVertices; ++i )
+ for (S32 i=0; i<face.mNumVertices; ++i )
{
pos[i].add( pivot );
}
@@ -110,7 +110,7 @@ void LLModel::offsetMesh( const LLVector3& pivotPoint )
void LLModel::remapVolumeFaces()
{
- for (U32 i = 0; i < getNumVolumeFaces(); ++i)
+ for (S32 i = 0; i < getNumVolumeFaces(); ++i)
{
mVolumeFaces[i].remap();
}
@@ -118,7 +118,7 @@ void LLModel::remapVolumeFaces()
void LLModel::optimizeVolumeFaces()
{
- for (U32 i = 0; i < getNumVolumeFaces(); ++i)
+ for (S32 i = 0; i < getNumVolumeFaces(); ++i)
{
mVolumeFaces[i].optimize();
}
@@ -173,7 +173,7 @@ void LLModel::trimVolumeFacesToSize(U32 new_count, LLVolume::face_list_t* remain
{
llassert(new_count <= LL_SCULPT_MESH_MAX_FACES);
- if (new_count && (getNumVolumeFaces() > new_count))
+ if (new_count > 0 && ((U32)getNumVolumeFaces() > new_count))
{
// Copy out remaining volume faces for alternative handling, if provided
//
@@ -224,7 +224,7 @@ void LLModel::normalizeVolumeFaces()
min_tc = face.mTexCoords[0];
max_tc = face.mTexCoords[0];
- for (U32 j = 1; j < face.mNumVertices; ++j)
+ for (S32 j = 1; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, face.mTexCoords[j]);
}
@@ -299,7 +299,7 @@ void LLModel::normalizeVolumeFaces()
LLVector4a* norm = (LLVector4a*) face.mNormals;
LLVector4a* t = (LLVector4a*)face.mTangents;
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
pos[j].add(trans);
pos[j].mul(scale);
@@ -363,7 +363,7 @@ LLVector3 LLModel::getTransformedCenter(const LLMatrix4& mat)
{
LLVolumeFace& face = mVolumeFaces[i];
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
m.affineTransform(face.mPositions[j],t);
update_min_max(minv, maxv, t);
@@ -475,7 +475,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
faceted.resizeVertices(vol_face.mNumIndices);
faceted.resizeIndices(vol_face.mNumIndices);
//bake out triangles into temporary face, clearing texture coordinates
- for (U32 i = 0; i < vol_face.mNumIndices; ++i)
+ for (S32 i = 0; i < vol_face.mNumIndices; ++i)
{
U32 idx = vol_face.mIndices[i];
@@ -485,7 +485,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//generate normals for temporary face
- for (U32 i = 0; i < faceted.mNumIndices; i += 3)
+ for (S32 i = 0; i < faceted.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = faceted.mIndices[i+0];
U16 i1 = faceted.mIndices[i+1];
@@ -514,12 +514,12 @@ void LLModel::generateNormals(F32 angle_cutoff)
//generate normals for welded face based on new topology (step 3)
- for (U32 i = 0; i < faceted.mNumVertices; i++)
+ for (S32 i = 0; i < faceted.mNumVertices; i++)
{
faceted.mNormals[i].clear();
}
- for (U32 i = 0; i < faceted.mNumIndices; i += 3)
+ for (S32 i = 0; i < faceted.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = faceted.mIndices[i+0];
U16 i1 = faceted.mIndices[i+1];
@@ -548,7 +548,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
//normalize normals and build point map
LLVolumeFace::VertexMapData::PointMap point_map;
- for (U32 i = 0; i < faceted.mNumVertices; ++i)
+ for (S32 i = 0; i < faceted.mNumVertices; ++i)
{
faceted.mNormals[i].normalize3();
@@ -566,7 +566,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
new_face.resizeIndices(vol_face.mNumIndices);
new_face.resizeVertices(vol_face.mNumIndices);
- for (U32 i = 0; i < vol_face.mNumIndices; ++i)
+ for (S32 i = 0; i < vol_face.mNumIndices; ++i)
{
U32 idx = vol_face.mIndices[i];
LLVolumeFace::VertexData v;
@@ -577,7 +577,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
if (vol_face.mTexCoords)
{
- for (U32 i = 0; i < vol_face.mNumIndices; i++)
+ for (S32 i = 0; i < vol_face.mNumIndices; i++)
{
U32 idx = vol_face.mIndices[i];
new_face.mTexCoords[i] = vol_face.mTexCoords[idx];
@@ -590,7 +590,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//generate normals for new face
- for (U32 i = 0; i < new_face.mNumIndices; i += 3)
+ for (S32 i = 0; i < new_face.mNumIndices; i += 3)
{ //for each triangle
U16 i0 = new_face.mIndices[i+0];
U16 i1 = new_face.mIndices[i+1];
@@ -615,7 +615,7 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
//swap out normals in new_face with best match from point map (step 5)
- for (U32 i = 0; i < new_face.mNumVertices; ++i)
+ for (S32 i = 0; i < new_face.mNumVertices; ++i)
{
//LLVolumeFace::VertexData v = new_face.mVertices[i];
@@ -725,7 +725,7 @@ LLSD LLModel::writeModel(
for (S32 i = 0; i < model[idx]->getNumVolumeFaces(); ++i)
{ //for each face
const LLVolumeFace& face = model[idx]->getVolumeFace(i);
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
update_min_max(min_pos, max_pos, face.mPositions[j].getF32ptr());
}
@@ -762,7 +762,7 @@ LLSD LLModel::writeModel(
max_tc = min_tc;
//get texture coordinate domain
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
update_min_max(min_tc, max_tc, ftc[j]);
}
@@ -770,7 +770,7 @@ LLSD LLModel::writeModel(
LLVector2 tc_range = max_tc - min_tc;
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{ //for each vert
F32* pos = face.mPositions[j].getF32ptr();
@@ -840,7 +840,7 @@ LLSD LLModel::writeModel(
}
U32 idx_idx = 0;
- for (U32 j = 0; j < face.mNumIndices; ++j)
+ for (S32 j = 0; j < face.mNumIndices; ++j)
{
U8* buff = (U8*) &(face.mIndices[j]);
indices[idx_idx++] = buff[0];
@@ -887,7 +887,7 @@ LLSD LLModel::writeModel(
// a bone index of 0xFF signifies no more influences for this vertex
std::stringstream ostr;
- for (U32 j = 0; j < face.mNumVertices; ++j)
+ for (S32 j = 0; j < face.mNumVertices; ++j)
{
LLVector3 pos(face.mPositions[j].getF32ptr());
@@ -2015,7 +2015,7 @@ bool ll_is_degenerate(const LLVector4a& a, const LLVector4a& b, const LLVector4a
bool validate_face(const LLVolumeFace& face)
{
- for (U32 i = 0; i < face.mNumIndices; ++i)
+ for (S32 i = 0; i < face.mNumIndices; ++i)
{
if (face.mIndices[i] >= face.mNumVertices)
{