summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-03-14 12:39:50 -0700
committerRichard Linden <none@none>2011-03-14 12:39:50 -0700
commit5038c068eac20425c702fd1dff06ccdacdec9e6f (patch)
treeed877903e95e222de503d262ae1fbef0ef57e9df /indra/llmath
parent405a748746c8ea040fe0efeda54e58f378289795 (diff)
SOCIAL-695 FIX clicking on world to give it focus will make your avatar walk
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/v3math.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index dbd38c1c3f..ef002fe9f2 100644
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -156,6 +156,8 @@ F32 dist_vec(const LLVector3 &a, const LLVector3 &b); // Returns distance betwe
F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b
F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b);// Returns distance squared between a and b ignoring Z component
LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b
+LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b); // Returns vector a projected on vector b (same as projected_vec)
+LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b); // Returns component of vector a not parallel to vector b (same as projected_vec)
LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
inline LLVector3::LLVector3(void)
@@ -490,6 +492,17 @@ inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
return project_axis * (a * project_axis);
}
+inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b)
+{
+ return projected_vec(a, b);
+}
+
+inline LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b)
+{
+ return a - projected_vec(a, b);
+}
+
+
inline LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u)
{
return LLVector3(