summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llmath.h15
-rw-r--r--indra/llmath/llvolume.cpp15
-rw-r--r--indra/llmath/llvolume.h7
3 files changed, 26 insertions, 11 deletions
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index 209b506c30..c3c15e1374 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -61,11 +61,11 @@
#endif
// Single Precision Floating Point Routines
-#ifndef fsqrtf
-#define fsqrtf(x) ((F32)sqrt((F64)(x)))
-#endif
#ifndef sqrtf
-#define sqrtf(x) ((F32)sqrt((F64)(x)))
+#define sqrtf(x) ((F32)sqrt((F64)(x)))
+#endif
+#ifndef fsqrtf
+#define fsqrtf(x) sqrtf(x)
#endif
#ifndef cosf
@@ -78,11 +78,14 @@
#define tanf(x) ((F32)tan((F64)(x)))
#endif
#ifndef acosf
-#define acosf(x) ((F32)acos((F64)(x)))
+#define acosf(x) ((F32)acos((F64)(x)))
#endif
#ifndef powf
-#define powf(x,y) ((F32)pow((F64)(x),(F64)(y)))
+#define powf(x,y) ((F32)pow((F64)(x),(F64)(y)))
+#endif
+#ifndef expf
+#define expf(x) ((F32)exp((F64)(x)))
#endif
const F32 GRAVITY = -9.8f;
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index cafa1e5c44..10cef533b0 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2546,10 +2546,12 @@ S32 LLVolume::getNumFaces() const
{
U8 sculpt_type = (mParams.getSculptType() & LL_SCULPT_TYPE_MASK);
+#if LL_MESH_ENABLED
if (sculpt_type == LL_SCULPT_TYPE_MESH)
{
return LL_SCULPT_MESH_MAX_FACES;
}
+#endif
return (S32)mProfilep->mFaces.size();
}
@@ -2922,11 +2924,6 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
LLMemType m1(LLMemType::MTYPE_VOLUME);
U8 sculpt_type = mParams.getSculptType();
- if (sculpt_type & LL_SCULPT_TYPE_MASK == LL_SCULPT_TYPE_MESH)
- {
- llerrs << "WTF?" << llendl;
- }
-
BOOL data_is_empty = FALSE;
if (sculpt_width == 0 || sculpt_height == 0 || sculpt_components < 3 || sculpt_data == NULL)
@@ -4135,10 +4132,12 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
normals.clear();
segments.clear();
+#if LL_MESH_ENABLED
if ((mParams.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_MESH)
{
return;
}
+#endif
S32 cur_index = 0;
//for each face
@@ -5567,6 +5566,8 @@ BOOL LLVolumeFace::createUnCutCubeCap(LLVolume* volume, BOOL partial_build)
corners[0].getPosition(), corners[0].mTexCoord,
corners[1].getPosition(), corners[1].mTexCoord,
corners[2].getPosition(), corners[2].mTexCoord);
+
+ binormal.normalize3fast();
S32 size = (grid_size+1)*(grid_size+1);
resizeVertices(size);
@@ -6335,10 +6336,14 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
resizeVertices(num_vertices);
resizeIndices(num_indices);
+#if LL_MESH_ENABLED
if ((volume->getParams().getSculptType() & LL_SCULPT_TYPE_MASK) != LL_SCULPT_TYPE_MESH)
{
mEdge.resize(num_indices);
}
+#else
+ mEdge.resize(num_indices);
+#endif
}
LLVector4a* pos = (LLVector4a*) mPositions;
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index c49d1c650d..0782944079 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -41,6 +41,8 @@ class LLVolumeParams;
class LLProfile;
class LLPath;
+#define LL_MESH_ENABLED 0
+
template <class T> class LLOctreeNode;
class LLVector4a;
@@ -190,10 +192,15 @@ const U8 LL_SCULPT_TYPE_SPHERE = 1;
const U8 LL_SCULPT_TYPE_TORUS = 2;
const U8 LL_SCULPT_TYPE_PLANE = 3;
const U8 LL_SCULPT_TYPE_CYLINDER = 4;
+#if LL_MESH_ENABLED
const U8 LL_SCULPT_TYPE_MESH = 5;
const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE |
LL_SCULPT_TYPE_CYLINDER | LL_SCULPT_TYPE_MESH;
+#else
+const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE |
+ LL_SCULPT_TYPE_CYLINDER;
+#endif
const U8 LL_SCULPT_FLAG_INVERT = 64;
const U8 LL_SCULPT_FLAG_MIRROR = 128;