diff options
author | Armin Weatherwax | 2010-06-14 12:04:49 +0200 |
---|---|---|
committer | Armin Weatherwax | 2010-09-23 15:38:25 +0200 |
commit | 35df5441d3e2789663532c948731aff3a1e04728 (patch) | |
tree | ac7674289784a5f96106ea507637055a8dada78a /linden/indra/llmath | |
parent | Changed version to Experimental 2010.09.18 (diff) | |
download | meta-impy-35df5441d3e2789663532c948731aff3a1e04728.zip meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.gz meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.bz2 meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.xz |
llmediaplugins first step
Diffstat (limited to 'linden/indra/llmath')
-rw-r--r-- | linden/indra/llmath/CMakeLists.txt | 1 | ||||
-rw-r--r-- | linden/indra/llmath/llmath.h | 10 | ||||
-rw-r--r-- | linden/indra/llmath/llvolume.cpp | 8 | ||||
-rw-r--r-- | linden/indra/llmath/llvolume.h | 10 | ||||
-rw-r--r-- | linden/indra/llmath/v3math.h | 4 |
5 files changed, 21 insertions, 12 deletions
diff --git a/linden/indra/llmath/CMakeLists.txt b/linden/indra/llmath/CMakeLists.txt index e5ec3e1..c05bf1d 100644 --- a/linden/indra/llmath/CMakeLists.txt +++ b/linden/indra/llmath/CMakeLists.txt | |||
@@ -83,3 +83,4 @@ set_source_files_properties(${llmath_HEADER_FILES} | |||
83 | list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) | 83 | list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) |
84 | 84 | ||
85 | add_library (llmath ${llmath_SOURCE_FILES}) | 85 | add_library (llmath ${llmath_SOURCE_FILES}) |
86 | add_dependencies(llmath prepare) | ||
diff --git a/linden/indra/llmath/llmath.h b/linden/indra/llmath/llmath.h index 9f8e539..0de568c 100644 --- a/linden/indra/llmath/llmath.h +++ b/linden/indra/llmath/llmath.h | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | #include <cmath> | 36 | #include <cmath> |
37 | #include <cstdlib> | 37 | #include <cstdlib> |
38 | #include <complex> | ||
38 | #include "lldefs.h" | 39 | #include "lldefs.h" |
39 | #include "llstl.h" // *TODO: Remove when LLString is gone | 40 | #include "llstl.h" // *TODO: Remove when LLString is gone |
40 | #include "llstring.h" // *TODO: Remove when LLString is gone | 41 | #include "llstring.h" // *TODO: Remove when LLString is gone |
@@ -60,7 +61,9 @@ | |||
60 | #endif | 61 | #endif |
61 | 62 | ||
62 | // Single Precision Floating Point Routines | 63 | // Single Precision Floating Point Routines |
63 | #if _MSC_VER < 1400 | 64 | #ifndef fsqrtf |
65 | #define fsqrtf(x) ((F32)sqrt((F64)(x))) | ||
66 | #endif | ||
64 | #ifndef sqrtf | 67 | #ifndef sqrtf |
65 | #define sqrtf(x) ((F32)sqrt((F64)(x))) | 68 | #define sqrtf(x) ((F32)sqrt((F64)(x))) |
66 | #endif | 69 | #endif |
@@ -81,11 +84,6 @@ | |||
81 | #ifndef powf | 84 | #ifndef powf |
82 | #define powf(x,y) ((F32)pow((F64)(x),(F64)(y))) | 85 | #define powf(x,y) ((F32)pow((F64)(x),(F64)(y))) |
83 | #endif | 86 | #endif |
84 | #endif | ||
85 | |||
86 | #ifndef fsqrtf | ||
87 | #define fsqrtf(x) sqrtf(x) | ||
88 | #endif | ||
89 | 87 | ||
90 | const F32 GRAVITY = -9.8f; | 88 | const F32 GRAVITY = -9.8f; |
91 | 89 | ||
diff --git a/linden/indra/llmath/llvolume.cpp b/linden/indra/llmath/llvolume.cpp index 4c94a52..b0b8a94 100644 --- a/linden/indra/llmath/llvolume.cpp +++ b/linden/indra/llmath/llvolume.cpp | |||
@@ -3376,7 +3376,8 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices, | |||
3376 | std::vector<S32> &segments, | 3376 | std::vector<S32> &segments, |
3377 | const LLVector3& obj_cam_vec, | 3377 | const LLVector3& obj_cam_vec, |
3378 | const LLMatrix4& mat, | 3378 | const LLMatrix4& mat, |
3379 | const LLMatrix3& norm_mat) | 3379 | const LLMatrix3& norm_mat, |
3380 | S32 face_mask) | ||
3380 | { | 3381 | { |
3381 | LLMemType m1(LLMemType::MTYPE_VOLUME); | 3382 | LLMemType m1(LLMemType::MTYPE_VOLUME); |
3382 | 3383 | ||
@@ -3384,12 +3385,17 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices, | |||
3384 | normals.clear(); | 3385 | normals.clear(); |
3385 | segments.clear(); | 3386 | segments.clear(); |
3386 | 3387 | ||
3388 | S32 cur_index = 0; | ||
3387 | //for each face | 3389 | //for each face |
3388 | for (face_list_t::iterator iter = mVolumeFaces.begin(); | 3390 | for (face_list_t::iterator iter = mVolumeFaces.begin(); |
3389 | iter != mVolumeFaces.end(); ++iter) | 3391 | iter != mVolumeFaces.end(); ++iter) |
3390 | { | 3392 | { |
3391 | const LLVolumeFace& face = *iter; | 3393 | const LLVolumeFace& face = *iter; |
3392 | 3394 | ||
3395 | if (!(face_mask & (0x1 << cur_index++))) | ||
3396 | { | ||
3397 | continue; | ||
3398 | } | ||
3393 | if (face.mTypeMask & (LLVolumeFace::CAP_MASK)) { | 3399 | if (face.mTypeMask & (LLVolumeFace::CAP_MASK)) { |
3394 | 3400 | ||
3395 | } | 3401 | } |
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h index 2b1c60d..0b9002f 100644 --- a/linden/indra/llmath/llvolume.h +++ b/linden/indra/llmath/llvolume.h | |||
@@ -905,9 +905,13 @@ public: | |||
905 | // returns number of triangle indeces required for path/profile mesh | 905 | // returns number of triangle indeces required for path/profile mesh |
906 | S32 getNumTriangleIndices() const; | 906 | S32 getNumTriangleIndices() const; |
907 | 907 | ||
908 | void generateSilhouetteVertices(std::vector<LLVector3> &vertices, std::vector<LLVector3> &normals, std::vector<S32> &segments, const LLVector3& view_vec, | 908 | void generateSilhouetteVertices(std::vector<LLVector3> &vertices, |
909 | const LLMatrix4& mat, | 909 | std::vector<LLVector3> &normals, |
910 | const LLMatrix3& norm_mat); | 910 | std::vector<S32> &segments, |
911 | const LLVector3& view_vec, | ||
912 | const LLMatrix4& mat, | ||
913 | const LLMatrix3& norm_mat, | ||
914 | S32 face_index); | ||
911 | 915 | ||
912 | //get the face index of the face that intersects with the given line segment at the point | 916 | //get the face index of the face that intersects with the given line segment at the point |
913 | //closest to start. Moves end to the point of intersection. Returns -1 if no intersection. | 917 | //closest to start. Moves end to the point of intersection. Returns -1 if no intersection. |
diff --git a/linden/indra/llmath/v3math.h b/linden/indra/llmath/v3math.h index 7f96800..8c65d93 100644 --- a/linden/indra/llmath/v3math.h +++ b/linden/indra/llmath/v3math.h | |||
@@ -411,8 +411,8 @@ inline bool operator<(const LLVector3 &a, const LLVector3 &b) | |||
411 | return (a.mV[0] < b.mV[0] | 411 | return (a.mV[0] < b.mV[0] |
412 | || (a.mV[0] == b.mV[0] | 412 | || (a.mV[0] == b.mV[0] |
413 | && (a.mV[1] < b.mV[1] | 413 | && (a.mV[1] < b.mV[1] |
414 | || (a.mV[1] == b.mV[1]) | 414 | || ((a.mV[1] == b.mV[1]) |
415 | && a.mV[2] < b.mV[2]))); | 415 | && a.mV[2] < b.mV[2])))); |
416 | } | 416 | } |
417 | 417 | ||
418 | inline const LLVector3& operator+=(LLVector3 &a, const LLVector3 &b) | 418 | inline const LLVector3& operator+=(LLVector3 &a, const LLVector3 &b) |