summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-03-07 18:37:09 +0000
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-03-07 18:37:09 +0000
commit62a0d579b5eb23ea306ade07afba76f7cba685c7 (patch)
treed6a8be1ffdb817098cadbc646eeb38385e5adcdf /indra/llmath
parentc11c17ed7b5c614a6c8505088aa709ddd9f1f1a4 (diff)
Move legacy atmospherics code outside of llvosky (begin teasing apart).
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/v3color.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h
index daf3a6857b..41dbdb8cd5 100644
--- a/indra/llmath/v3color.h
+++ b/indra/llmath/v3color.h
@@ -100,6 +100,23 @@ public:
const LLColor3& operator=(const LLColor4 &a);
+ LL_FORCE_INLINE LLColor3 divide(const LLColor3 &col2)
+ {
+ return LLColor3(
+ mV[0] / col2.mV[0],
+ mV[1] / col2.mV[1],
+ mV[2] / col2.mV[2] );
+ }
+
+ LL_FORCE_INLINE LLColor3 color_norm()
+ {
+ F32 l = length();
+ return LLColor3(
+ mV[0] / l,
+ mV[1] / l,
+ mV[2] / l );
+ }
+
friend std::ostream& operator<<(std::ostream& s, const LLColor3 &a); // Print a
friend LLColor3 operator+(const LLColor3 &a, const LLColor3 &b); // Return vector a + b
friend LLColor3 operator-(const LLColor3 &a, const LLColor3 &b); // Return vector a minus b