summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorsimon <none@none>2015-04-15 15:07:13 -0700
committersimon <none@none>2015-04-15 15:07:13 -0700
commita219cf1c98527faa0e7addeb9660f679208bb0e7 (patch)
tree78a14774f7ff79dd92c022caa2d9d68ec85fba85 /indra/llmath
parentb5324afb6f2e45deefb9b79e7e2192bc686b181a (diff)
parenta647b8f1cbab13f07ea889c80df28414bc906129 (diff)
Merge viewer-release
Diffstat (limited to 'indra/llmath')
-rwxr-xr-xindra/llmath/llsphere.cpp6
-rwxr-xr-xindra/llmath/llvolume.cpp18
-rwxr-xr-xindra/llmath/llvolume.h3
3 files changed, 23 insertions, 4 deletions
diff --git a/indra/llmath/llsphere.cpp b/indra/llmath/llsphere.cpp
index 740047b93a..a8d6200488 100755
--- a/indra/llmath/llsphere.cpp
+++ b/indra/llmath/llsphere.cpp
@@ -248,8 +248,8 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list)
// compute the starting step-size
F32 minimum_radius = 0.5f * llmin(diagonal.mV[VX], llmin(diagonal.mV[VY], diagonal.mV[VZ]));
F32 step_length = bounding_radius - minimum_radius;
- S32 step_count = 0;
- S32 max_step_count = 12;
+ //S32 step_count = 0;
+ //S32 max_step_count = 12;
F32 half_milimeter = 0.0005f;
// wander the center around in search of tighter solutions
@@ -258,7 +258,7 @@ LLSphere LLSphere::getBoundingSphere(const std::vector<LLSphere>& sphere_list)
S32 last_dz = 2;
while (step_length > half_milimeter
- && step_count < max_step_count)
+ /*&& step_count < max_step_count*/)
{
// the algorithm for testing the maximum radius could be expensive enough
// that it makes sense to NOT duplicate testing when possible, so we keep
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);
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 2f38ae7203..c8476f6897 100755
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -993,6 +993,7 @@ public:
void resizePath(S32 length);
const LLAlignedArray<LLVector4a,64>& getMesh() const { return mMesh; }
const LLVector4a& getMeshPt(const U32 i) const { return mMesh[i]; }
+
void setDirty() { mPathp->setDirty(); mProfilep->setDirty(); }
@@ -1045,6 +1046,8 @@ public:
void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level);
void copyVolumeFaces(const LLVolume* volume);
+ void copyFacesTo(std::vector<LLVolumeFace> &faces) const;
+ void copyFacesFrom(const std::vector<LLVolumeFace> &faces);
void cacheOptimize();
private: