summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-04-20 14:27:22 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-04-20 14:27:22 +0300
commit74d6e6b65c9c3e85e8ec84939b35a1e584379e1f (patch)
tree594978c1282ff02e37525b6f94f310d4299a1583 /indra/llmath
parent70d340a1bff2707138ac41fdd1408a5b2e46fc71 (diff)
SL-12904 FIXED Camera Preset does not restore correctly when sitting
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/llquaternion.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h
index aa0b1752f4..95e4c09695 100644
--- a/indra/llmath/llquaternion.h
+++ b/indra/llmath/llquaternion.h
@@ -28,6 +28,7 @@
#define LLQUATERNION_H
#include <iostream>
+#include <llsd.h>
#ifndef LLMATH_H //enforce specific include order to avoid tangling inline dependencies
#error "Please include llmath.h first."
@@ -64,6 +65,29 @@ public:
const LLVector3 &y_axis,
const LLVector3 &z_axis); // Initializes Quaternion from Matrix3 = [x_axis ; y_axis ; z_axis]
+ explicit LLQuaternion(const LLSD& sd)
+ {
+ setValue(sd);
+ }
+
+ void setValue(const LLSD& sd)
+ {
+ mQ[VX] = (F32) sd[0].asReal();
+ mQ[VY] = (F32) sd[1].asReal();
+ mQ[VZ] = (F32) sd[2].asReal();
+ mQ[VS] = (F32) sd[3].asReal();
+ }
+
+ LLSD getValue() const
+ {
+ LLSD ret;
+ ret[0] = mQ[VX];
+ ret[1] = mQ[VY];
+ ret[2] = mQ[VZ];
+ ret[3] = mQ[VS];
+ return ret;
+ }
+
BOOL isIdentity() const;
BOOL isNotIdentity() const;
BOOL isFinite() const; // checks to see if all values of LLQuaternion are finite