summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorprep linden <prep@lindenlab.com>2011-02-28 12:20:31 -0500
committerprep linden <prep@lindenlab.com>2011-02-28 12:20:31 -0500
commit4abb8b33fa0c3b5e5f809a783cfc62a9e02af338 (patch)
tree90d472cdc1d9aa8af8bb9fc3989dab4b86c0f778 /indra/llprimitive
parent3ce756e44cca0cf6f9860871789e348647800e45 (diff)
sh-517 Content authors can specify a pivot node (Assetpivot).
Diffstat (limited to 'indra/llprimitive')
-rwxr-xr-xindra/llprimitive/llmodel.cpp16
-rwxr-xr-xindra/llprimitive/llmodel.h2
2 files changed, 17 insertions, 1 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 3d03209eaf..a9101378a4 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;