diff options
author | Tofu Buzzard <no-email> | 2011-02-28 13:01:40 -0800 |
---|---|---|
committer | Tofu Buzzard <no-email> | 2011-02-28 13:01:40 -0800 |
commit | 858a544dc97b340f0cd2ad21c677f8683935c1fa (patch) | |
tree | f18df2b305522d1ed888690012df45b4cc5bf52d /indra/llprimitive | |
parent | 41dc7188ea0b5a1031e82ef8a1b3861107b16216 (diff) | |
parent | 10f14598243ef93f8990f9a1473334ef918f9cf7 (diff) |
merge
Diffstat (limited to 'indra/llprimitive')
-rwxr-xr-x | indra/llprimitive/llmodel.cpp | 16 | ||||
-rwxr-xr-x | indra/llprimitive/llmodel.h | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 5f9ed850c9..4ce5c15898 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -810,6 +810,22 @@ BOOL LLModel::createVolumeFacesFromFile(const std::string& file_name) return FALSE; } +void LLModel::offsetMesh( const LLVector3& pivotPoint ) +{ + LLVector4a pivot( pivotPoint[VX], pivotPoint[VY], pivotPoint[VZ] ); + + for (std::vector<LLVolumeFace>::iterator faceIt = mVolumeFaces.begin(); faceIt != mVolumeFaces.end(); ) + { + std::vector<LLVolumeFace>:: iterator currentFaceIt = faceIt++; + LLVolumeFace& face = *currentFaceIt; + LLVector4a *pos = (LLVector4a*) face.mPositions; + + for (U32 i=0; i<face.mNumVertices; ++i ) + { + pos[i].add( pivot ); + } + } +} void LLModel::optimizeVolumeFaces() { diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index ebf37904d4..c10ca1c11b 100755 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -123,7 +123,7 @@ public: void normalizeVolumeFaces(); void optimizeVolumeFaces(); - + void offsetMesh( const LLVector3& pivotPoint ); void getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& translation_out); std::vector<std::string> mMaterialList; |