diff options
author | Dave Parks <davep@lindenlab.com> | 2010-02-17 11:33:47 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-02-17 11:33:47 -0600 |
commit | 3bca0fceb21c0e08908125608059cec0860bafbe (patch) | |
tree | 7cb1b35bf1d2e8968273e2a424eafcad8d9f1fe9 /indra/llmath | |
parent | 2398ac98d01d3809904759251e2c98cf2740e139 (diff) | |
parent | de88d6ced487fd55fa6f6bb860849979f031a363 (diff) |
merge
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llvolume.cpp | 31 | ||||
-rw-r--r-- | indra/llmath/llvolume.h | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 7fd9b57f51..7c98536e72 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5615,6 +5615,37 @@ void LLVolumeFace::createBinormals() } } +void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat, LLMatrix4& norm_mat) +{ + U16 offset = mVertices.size(); + + + for (U32 i = 0; i < face.mVertices.size(); ++i) + { + VertexData v = face.mVertices[i]; + v.mPosition = v.mPosition*mat; + v.mNormal = v.mNormal * norm_mat; + + + mVertices.push_back(v); + + if (offset == 0 && i == 0) + { + mExtents[0] = mExtents[1] = v.mPosition; + } + else + { + update_min_max(mExtents[0], mExtents[1], v.mPosition); + } + } + + + for (U32 i = 0; i < face.mIndices.size(); ++i) + { + mIndices.push_back(face.mIndices[i]+offset); + } +} + BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build) { LLMemType m1(LLMemType::MTYPE_VOLUME); diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index b871dad22a..36811785dc 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -805,6 +805,8 @@ public: void createBinormals(); void makeTriStrip(); + void appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& normal_tranform); + class VertexData { public: |