diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/llmath/v3math.h | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to 'linden/indra/llmath/v3math.h')
-rw-r--r-- | linden/indra/llmath/v3math.h | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/linden/indra/llmath/v3math.h b/linden/indra/llmath/v3math.h index 68e60de..e7134eb 100644 --- a/linden/indra/llmath/v3math.h +++ b/linden/indra/llmath/v3math.h | |||
@@ -37,7 +37,7 @@ class LLMatrix3; | |||
37 | class LLVector3d; | 37 | class LLVector3d; |
38 | class LLQuaternion; | 38 | class LLQuaternion; |
39 | 39 | ||
40 | // Llvector3 = |x y z w| | 40 | // LLvector3 = |x y z w| |
41 | 41 | ||
42 | static const U32 LENGTHOFVECTOR3 = 3; | 42 | static const U32 LENGTHOFVECTOR3 = 3; |
43 | 43 | ||
@@ -60,32 +60,13 @@ class LLVector3 | |||
60 | inline explicit LLVector3(const F32 *vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) | 60 | inline explicit LLVector3(const F32 *vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) |
61 | explicit LLVector3(const LLVector3d &vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) | 61 | explicit LLVector3(const LLVector3d &vec); // Initializes LLVector3 to (vec[0]. vec[1], vec[2]) |
62 | explicit LLVector3(const LLVector4 &vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2]) | 62 | explicit LLVector3(const LLVector4 &vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2]) |
63 | LLVector3(const LLSD& sd) | 63 | LLVector3(const LLSD& sd); |
64 | { | ||
65 | setValue(sd); | ||
66 | } | ||
67 | 64 | ||
68 | LLSD getValue() const | 65 | LLSD getValue() const; |
69 | { | ||
70 | LLSD ret; | ||
71 | ret[0] = mV[0]; | ||
72 | ret[1] = mV[1]; | ||
73 | ret[2] = mV[2]; | ||
74 | return ret; | ||
75 | } | ||
76 | 66 | ||
77 | void setValue(const LLSD& sd) | 67 | void setValue(const LLSD& sd); |
78 | { | ||
79 | mV[0] = (F32) sd[0].asReal(); | ||
80 | mV[1] = (F32) sd[1].asReal(); | ||
81 | mV[2] = (F32) sd[2].asReal(); | ||
82 | } | ||
83 | 68 | ||
84 | const LLVector3& operator=(const LLSD& sd) | 69 | const LLVector3& operator=(const LLSD& sd); |
85 | { | ||
86 | setValue(sd); | ||
87 | return *this; | ||
88 | } | ||
89 | 70 | ||
90 | inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite | 71 | inline BOOL isFinite() const; // checks to see if all values of LLVector3 are finite |
91 | BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed | 72 | BOOL clamp(F32 min, F32 max); // Clamps all values to (min,max), returns TRUE if data changed |
@@ -434,6 +415,20 @@ inline BOOL LLVector3::isNull() const | |||
434 | return FALSE; | 415 | return FALSE; |
435 | } | 416 | } |
436 | 417 | ||
418 | inline void update_min_max(LLVector3& min, LLVector3& max, const LLVector3& pos) | ||
419 | { | ||
420 | for (U32 i = 0; i < 3; i++) | ||
421 | { | ||
422 | if (min.mV[i] > pos.mV[i]) | ||
423 | { | ||
424 | min.mV[i] = pos.mV[i]; | ||
425 | } | ||
426 | if (max.mV[i] < pos.mV[i]) | ||
427 | { | ||
428 | max.mV[i] = pos.mV[i]; | ||
429 | } | ||
430 | } | ||
431 | } | ||
437 | 432 | ||
438 | inline F32 angle_between(const LLVector3& a, const LLVector3& b) | 433 | inline F32 angle_between(const LLVector3& a, const LLVector3& b) |
439 | { | 434 | { |