Go to the documentation of this file.
116 dest->
m_x = -thisPtr->
m_x;
117 dest->
m_y = -thisPtr->
m_y;
118 dest->
m_z = -thisPtr->
m_z;
127 if (thisPtr->
m_w < 0)
130 dest->
m_w = thisPtr->
m_w * divisor;
131 dest->
m_x = thisPtr->
m_x * divisor;
132 dest->
m_y = thisPtr->
m_y * divisor;
133 dest->
m_z = thisPtr->
m_z * divisor;
148 XsReal cosX, sinX, cosY, sinY, cosZ, sinZ;
163 thisPtr->
m_w = cosX * cosY * cosZ + sinX * sinY * sinZ;
164 thisPtr->
m_x = sinX * cosY * cosZ - cosX * sinY * sinZ;
165 thisPtr->
m_y = cosX * sinY * cosZ + sinX * cosY * sinZ;
166 thisPtr->
m_z = cosX * cosY * sinZ - sinX * sinY * cosZ;
252 static const XsQuaternion sIdentity = { { { 1, 0, 0, 0 } } };
269 dest->
m_w = qa0 * qb0 - qa1 * qb1 - qa2 * qb2 - qa3 * qb3;
270 dest->
m_x = qa1 * qb0 + qa0 * qb1 - qa3 * qb2 + qa2 * qb3;
271 dest->
m_y = qa2 * qb0 + qa3 * qb1 + qa0 * qb2 - qa1 * qb3;
272 dest->
m_z = qa3 * qb0 - qa2 * qb1 + qa1 * qb2 + qa0 * qb3;
281 for (i = 0; i < 4; ++i)
303 return (a->
m_w == b->
m_w &&
317 return fabs(a - b) <= tolerance;
325 if (thisPtr == other)
345 return (thisPtr->
m_w * other->
m_w) +
346 (thisPtr->
m_x * other->
m_x) +
347 (thisPtr->
m_y * other->
m_y) +
348 (thisPtr->
m_z * other->
m_z);
void XsQuaternion_fromRotationMatrix(XsQuaternion *thisPtr, const XsMatrix *ori)
Create a quaternion representation of orientation matrix ori.
A class that represents a matrix of real numbers.
void XsQuaternion_invert(XsQuaternion *thisPtr)
Invert this quaternion.
XSMATHCONST XsReal XsMath_one
1.0
XsReal XsMatrix_value(const XsMatrix *thisPtr, XsSize row, XsSize column)
Returns the data value at row and column.
XsReal m_x
Stores the x component of the euler triplet.
XsReal XsQuaternion_normalized(const XsQuaternion *thisPtr, XsQuaternion *dest)
Create a normalized version of this quaternion.
void XsQuaternion_copy(XsQuaternion *copy, XsQuaternion const *src)
Copies the contents of thisPtr into copy.
XSMATHCONST XsReal XsMath_tinyValue
A really small value.
int XsMatrix_dimensionsMatch(const XsMatrix *thisPtr, XsSize rows, XsSize columns)
Returns not zero if the dimensions of the XsMatrix are equal to rows and columns.
A class that implements a quaternion.
void XsQuaternion_inverse(const XsQuaternion *thisPtr, XsQuaternion *dest)
Compute the inverse/conjugate of this quaternion.
static int fuzzyIsEqual(double a, double b, double tolerance)
Checks whether a and b are equal with tolerance tolerance.
int XsQuaternion_empty(const XsQuaternion *thisPtr)
Test if this is a null object.
XSMATHCONST XsReal XsMath_pt5
0.5
XsReal XsQuaternion_dotProduct(XsQuaternion const *thisPtr, XsQuaternion const *other)
Returns the dot product of the thisPtr with other.
double XsReal
Defines the floating point type used by the Xsens libraries.
int XsQuaternion_equal(XsQuaternion const *a, XsQuaternion const *b)
returns non-zero if a and b are numerically equal
XSMATHCONST XsReal XsMath_pt25
0.25
void XsQuaternion_multiply(const XsQuaternion *left, const XsQuaternion *right, XsQuaternion *dest)
Multiply left quaternion with right quaternion and put the result in dest. The parameters may point t...
const XsQuaternion * XsQuaternion_identity(void)
Returns an XsQuaternion that represents the identity quaternion.
XsReal m_x
Stores the x component of the quaternion.
XsReal m_data[4]
Stores the quaternion in an array of four elements.
XsReal m_z
Stores the z component of the euler triplet.
XSMATHCONST XsReal XsMath_two
2
XSMATHCONST XsReal XsMath_zero
0
void XsQuaternion_swap(XsQuaternion *a, XsQuaternion *b)
Swap the contents of a and b.
Contains Euler Angle data and conversion from Quaternion.
TF2SIMD_FORCE_INLINE tf2Scalar length(const Quaternion &q)
XsReal m_y
Stores the y component of the quaternion.
XSMATHINLINE XsReal XsMath_deg2rad(XsReal degrees)
Convert degrees to radians.
void XsQuaternion_destruct(XsQuaternion *thisPtr)
Sets the contents to 0, which is an invalid XsQuaternion.
XsReal m_y
Stores the y component of the euler triplet.
XsReal m_w
Stores the w component of the quaternion.
int XsQuaternion_compare(XsQuaternion const *thisPtr, XsQuaternion const *other, XsReal tolerance)
Returns non-zero if the values at thisPtr and other are within tolerance of each other.
XsReal m_z
Stores the z component of the quaternion.
int XsEuler_empty(const XsEuler *thisPtr)
Returns true if all angles in this object are zero.
void XsQuaternion_fromEulerAngles(XsQuaternion *thisPtr, const XsEuler *src)
Create a quaternion representation from euler angles.
XsReal XsQuaternion_normalize(XsQuaternion *thisPtr)
Normalize this quaternion.