summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llvolume.cpp20
-rw-r--r--indra/llmath/llvolume.h2
2 files changed, 17 insertions, 5 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index d1716e1407..7e1517fba7 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5614,19 +5614,31 @@ void LLVolumeFace::createBinormals()
}
}
-void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& norm_transform)
+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 *= mat;
- v.mNormal *= norm_transform;
+ 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);
+ }
}
- U16 offset = mIndices.size();
+
for (U32 i = 0; i < face.mIndices.size(); ++i)
{
mIndices.push_back(face.mIndices[i]+offset);
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 1059c29566..36811785dc 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -805,7 +805,7 @@ public:
void createBinormals();
void makeTriStrip();
- void appendFace(const LLVolumeFace& face);
+ void appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& normal_tranform);
class VertexData
{