summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-04-13 17:20:36 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-04-13 17:20:36 -0400
commitd516a8729e413e3097c468e8f3c2c39ff73181bd (patch)
tree3ba17c58af42f23e77199516be4674245328cd86 /indra/llmath/llvolume.cpp
parent3f001b520c42d9182de89c3cacb79f6684dd0471 (diff)
parenta647b8f1cbab13f07ea889c80df28414bc906129 (diff)
merge
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rwxr-xr-xindra/llmath/llvolume.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index d9a68cb577..adf6e790d3 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2685,6 +2685,17 @@ void LLVolume::setMeshAssetLoaded(BOOL loaded)
mIsMeshAssetLoaded = loaded;
}
+void LLVolume::copyFacesTo(std::vector<LLVolumeFace> &faces) const
+{
+ faces = mVolumeFaces;
+}
+
+void LLVolume::copyFacesFrom(const std::vector<LLVolumeFace> &faces)
+{
+ mVolumeFaces = faces;
+ mSculptLevel = 0;
+}
+
void LLVolume::copyVolumeFaces(const LLVolume* volume)
{
mVolumeFaces = volume->mVolumeFaces;
@@ -5970,7 +5981,10 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
}
else
{ //degenerate, make up a value
- normal.set(0,0,1);
+ if(normal.getF32ptr()[2] >= 0)
+ normal.set(0.f,0.f,1.f);
+ else
+ normal.set(0.f,0.f,-1.f);
}
llassert(llfinite(normal.getF32ptr()[0]));
@@ -6284,6 +6298,8 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
num_vertices = mNumS*mNumT;
num_indices = (mNumS-1)*(mNumT-1)*6;
+ partial_build = (num_vertices > mNumVertices || num_indices > mNumIndices) ? FALSE : partial_build;
+
if (!partial_build)
{
resizeVertices(num_vertices);