summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-02-17 15:51:39 -0600
committerDave Parks <davep@lindenlab.com>2010-02-17 15:51:39 -0600
commit161aff8e86ae690e6ba4124c9433bfed5025b133 (patch)
tree01a26a48305972fd84b95ce9ab9c8daed917eafa /indra/llmath
parentd4d84c899780acdf2ade3f2951e1272d51227170 (diff)
parent74621ff8a8a141d50a3c92430afbe53a9e00edb5 (diff)
merge
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp31
-rw-r--r--indra/llmath/llvolume.h2
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: