TrueReality  v0.1.1912
trBase::Quat Class Reference

Represents a quaternion, that is used for angular calculations and transformations. More...

#include <Quat.h>

Public Types

using value_type = double
 

Public Member Functions

 Quat ()
 Default constructor. More...
 
 Quat (const Quat &q)
 Copy constructor. More...
 
 Quat (const osg::Quat &q)
 Constructor. More...
 
 Quat (value_type x, value_type y, value_type z, value_type w)
 Constructor. More...
 
 Quat (const Vec4f &v)
 Constructor. More...
 
 Quat (const Vec4d &v)
 Constructor. More...
 
 Quat (value_type angle, const Vec3f &axis)
 Constructor. More...
 
 Quat (value_type angle, const Vec3d &axis)
 Constructor. More...
 
 Quat (value_type angle1, const Vec3f &axis1, value_type angle2, const Vec3f &axis2, value_type angle3, const Vec3f &axis3)
 Creates a quaternion after making three individual quaternions, one for each angle and axis, and multiplying them together. More...
 
 Quat (value_type angle1, const Vec3d &axis1, value_type angle2, const Vec3d &axis2, value_type angle3, const Vec3d &axis3)
 Creates a quaternion after making three individual quaternions, one for each angle and axis, and multiplying them together. More...
 
osg::Quat & GetOSGQuat ()
 Returns a reference to the internal OSG Quat. More...
 
const osg::Quat & GetOSGQuat () const
 Returns a reference to the internal OSG Quat. More...
 
Vec4d AsVec4 () const
 Converts this object to a vector 4. More...
 
Vec3d AsVec3 () const
 Converts this object to a vector 3. More...
 
void Set (const Quat &q)
 Sets the given q. More...
 
void Set (const osg::Quat &q)
 Sets the given q. More...
 
void Set (value_type x, value_type y, value_type z, value_type w)
 Sets. More...
 
void Set (const Vec4f &v)
 Sets the given v. More...
 
void Set (const Vec4d &v)
 Sets the given v. More...
 
void Set (const Matrixf &matrix)
 Sets the quaternion from the given matrix. More...
 
void Set (const Matrixd &matrix)
 Sets the quaternion from the given matrix. More...
 
void Get (Matrixf &matrix) const
 Sets the quaternion from the given matrix. More...
 
void Get (Matrixd &matrix) const
 Sets the quaternion from the given matrix. More...
 
void Set (const osg::Matrixf &matrix)
 Sets the given matrix. More...
 
void Set (const osg::Matrixd &matrix)
 Sets the given matrix. More...
 
void Get (osg::Matrixf &matrix) const
 Gets a the values of the internal matrix. More...
 
void Get (osg::Matrixd &matrix) const
 Gets a the values of the internal matrix. More...
 
bool IsZeroRotation () const
 return true if the Quat represents a zero rotation, and therefore can be ignored in computations. More...
 
value_type Length () const
 Length of the quaternion = sqrt( vec . More...
 
value_type Length2 () const
 (Length*Length) of the quaternion = vec . More...
 
trBase::Quat Conj () const
 Conjugate. More...
 
const trBase::Quat Inverse () const
 Multiplicative inverse method: q^(-1) = q^* /(q.q^*) More...
 
void MakeRotate (value_type angle, value_type x, value_type y, value_type z)
 Set a quaternion which will perform a rotation of an angle around the axis given by the vector(x, y, z). More...
 
void MakeRotate (value_type angle, const Vec3f &vec)
 Set a quaternion which will perform a rotation of an angle around the axis given by the vector(x, y, z). More...
 
void MakeRotate (value_type angle, const Vec3d &vec)
 Set a quaternion which will perform a rotation of an angle around the axis given by the vector(x, y, z). More...
 
void MakeRotate (value_type angle1, const Vec3f &axis1, value_type angle2, const Vec3f &axis2, value_type angle3, const Vec3f &axis3)
 Set a quaternion which will perform a rotation of an angles around three axes given by the vectors(x, y, z). More...
 
void MakeRotate (value_type angle1, const Vec3d &axis1, value_type angle2, const Vec3d &axis2, value_type angle3, const Vec3d &axis3)
 Set a quaternion which will perform a rotation of an angles around three axes given by the vectors(x, y, z). More...
 
void MakeRotate (const Vec3f &vec1, const Vec3f &vec2)
 Make a rotation Quat which will rotate vec1 to vec2. More...
 
void MakeRotate (const Vec3d &vec1, const Vec3d &vec2)
 Make a rotation Quat which will rotate vec1 to vec2. More...
 
void GetRotate (value_type &angle, value_type &x, value_type &y, value_type &z) const
 Return the angle and vector components represented by the quaternion. More...
 
void GetRotate (value_type &angle, Vec3f &vec) const
 Return the angle and vector represented by the quaternion. More...
 
void GetRotate (value_type &angle, Vec3d &vec) const
 Return the angle and vector represented by the quaternion. More...
 
void Clear ()
 Clears this object to its blank/initial state. More...
 
void Slerp (value_type t, const Quat &from, const Quat &to)
 Spherical Linear Interpolation. More...
 
value_typeX ()
 Returns the X component of the quaternion/. More...
 
value_typeY ()
 Returns the Y component of the quaternion/. More...
 
value_typeZ ()
 Returns the Z component of the quaternion/. More...
 
value_typeW ()
 Returns the W component of the quaternion/. More...
 
value_type X () const
 Returns the X component of the quaternion/. More...
 
value_type Y () const
 Returns the Y component of the quaternion/. More...
 
value_type Z () const
 Returns the Z component of the quaternion/. More...
 
value_type W () const
 Returns the W component of the quaternion/. More...
 
value_typeoperator[] (int i)
 Index operator. More...
 
value_type operator[] (int i) const
 Index operator. More...
 
Quatoperator= (const Quat &v)
 Set operator. More...
 
bool operator== (const Quat &v) const
 Equals operator. More...
 
bool operator!= (const Quat &v) const
 Not equals operator. More...
 
bool operator< (const Quat &v) const
 Less than operator. More...
 
bool operator> (const Quat &v) const
 Greater than operator. More...
 
const Quat operator* (value_type rhs) const
 Multiply by scalar. More...
 
Vec3f operator* (const Vec3f &v) const
 Rotate a vector by this quaternion. More...
 
Vec3d operator* (const Vec3d &v) const
 Rotate a vector by this quaternion. More...
 
Quatoperator*= (value_type rhs)
 Unary multiply by scalar. More...
 
const Quat operator* (const Quat &rhs) const
 Binary multiply. More...
 
Quatoperator*= (const Quat &rhs)
 Unary multiply. More...
 
Quat operator/ (value_type rhs) const
 Divide by scalar. More...
 
Quatoperator/= (value_type rhs)
 Unary divide by scalar. More...
 
const Quat operator/ (const Quat &denom) const
 Binary divide. More...
 
Quatoperator/= (const Quat &denom)
 Unary divide. More...
 
const Quat operator+ (const Quat &rhs) const
 Binary addition. More...
 
Quatoperator+= (const Quat &rhs)
 Unary addition. More...
 
const Quat operator- (const Quat &rhs) const
 Binary subtraction. More...
 
Quatoperator-= (const Quat &rhs)
 Unary subtraction. More...
 
const Quat operator- () const
 Negation operator - returns the negative of the quaternion. More...
 
 operator osg::Quat () const
 Implicit conversion operator to OSG Quaternion. More...
 
 operator osg::Quat & ()
 Implicit conversion operator to OSG Quaternion. More...
 
 operator const osg::Quat & () const
 Implicit conversion operator to OSG Quaternion. More...
 
 operator osg::Quat * ()
 Implicit conversion operator to OSG Quaternion. More...
 
std::string ToString (int precision=-1)
 Convert this object into a string representation. More...
 

Protected Attributes

osg::Quat mQuat
 

Detailed Description

Represents a quaternion, that is used for angular calculations and transformations.

Definition at line 44 of file Quat.h.

Member Typedef Documentation

◆ value_type

using trBase::Quat::value_type = double

Definition at line 48 of file Quat.h.

Constructor & Destructor Documentation

◆ Quat() [1/10]

trBase::Quat::Quat ( )

Default constructor.

Definition at line 29 of file Quat.cpp.

Referenced by Conj(), operator*(), operator+(), operator-(), and operator/().

Here is the caller graph for this function:

◆ Quat() [2/10]

trBase::Quat::Quat ( const Quat q)

Copy constructor.

Parameters
[in,out]qThe Quat to process.

Definition at line 34 of file Quat.cpp.

◆ Quat() [3/10]

trBase::Quat::Quat ( const osg::Quat &  q)

Constructor.

Parameters
[in,out]qThe osg::Quat to process.

Definition at line 40 of file Quat.cpp.

◆ Quat() [4/10]

trBase::Quat::Quat ( value_type  x,
value_type  y,
value_type  z,
value_type  w 
)

Constructor.

Parameters
xThe x to process.
yThe y to process.
zThe z to process.
wThe w to process.

Definition at line 46 of file Quat.cpp.

◆ Quat() [5/10]

trBase::Quat::Quat ( const Vec4f v)

Constructor.

Parameters
vThe Vec4f to process.

Definition at line 52 of file Quat.cpp.

◆ Quat() [6/10]

trBase::Quat::Quat ( const Vec4d v)

Constructor.

Parameters
vThe Vec4d to process.

Definition at line 58 of file Quat.cpp.

◆ Quat() [7/10]

trBase::Quat::Quat ( value_type  angle,
const Vec3f axis 
)

Constructor.

Parameters
angleThe angle.
axisThe axis.

Definition at line 64 of file Quat.cpp.

◆ Quat() [8/10]

trBase::Quat::Quat ( value_type  angle,
const Vec3d axis 
)

Constructor.

Parameters
angleThe angle.
axisThe axis.

Definition at line 70 of file Quat.cpp.

◆ Quat() [9/10]

trBase::Quat::Quat ( value_type  angle1,
const Vec3f axis1,
value_type  angle2,
const Vec3f axis2,
value_type  angle3,
const Vec3f axis3 
)

Creates a quaternion after making three individual quaternions, one for each angle and axis, and multiplying them together.

Q = q(angle1, axis1)*q(angle2, axis2)*q(angle3, axis3)

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.

Definition at line 76 of file Quat.cpp.

◆ Quat() [10/10]

trBase::Quat::Quat ( value_type  angle1,
const Vec3d axis1,
value_type  angle2,
const Vec3d axis2,
value_type  angle3,
const Vec3d axis3 
)

Creates a quaternion after making three individual quaternions, one for each angle and axis, and multiplying them together.

Q = q(angle1, axis1)*q(angle2, axis2)*q(angle3, axis3)

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.

Definition at line 82 of file Quat.cpp.

Member Function Documentation

◆ AsVec3()

Vec3d trBase::Quat::AsVec3 ( ) const

Converts this object to a vector 3.

Returns
A Vec3d.

Definition at line 106 of file Quat.cpp.

References mQuat.

◆ AsVec4()

Vec4d trBase::Quat::AsVec4 ( ) const

Converts this object to a vector 4.

Returns
A Vec4d.

Definition at line 100 of file Quat.cpp.

References mQuat.

◆ Clear()

void trBase::Quat::Clear ( )

Clears this object to its blank/initial state.

Definition at line 295 of file Quat.cpp.

References mQuat.

◆ Conj()

trBase::Quat trBase::Quat::Conj ( ) const

Conjugate.

Returns
A Quat.

Definition at line 223 of file Quat.cpp.

References mQuat, and Quat().

Referenced by Inverse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/4]

void trBase::Quat::Get ( Matrixf matrix) const

Sets the quaternion from the given matrix.

Definition at line 169 of file Quat.cpp.

References mQuat.

◆ Get() [2/4]

void trBase::Quat::Get ( Matrixd matrix) const

Sets the quaternion from the given matrix.

Definition at line 175 of file Quat.cpp.

References mQuat.

◆ Get() [3/4]

void trBase::Quat::Get ( osg::Matrixf &  matrix) const

Gets a the values of the internal matrix.

Parameters
[in,out]matrixThe matrix to get.

Definition at line 193 of file Quat.cpp.

References mQuat.

◆ Get() [4/4]

void trBase::Quat::Get ( osg::Matrixd &  matrix) const

Gets a the values of the internal matrix.

Parameters
[in,out]matrixThe matrix to get.

Definition at line 199 of file Quat.cpp.

References mQuat.

◆ GetOSGQuat() [1/2]

osg::Quat & trBase::Quat::GetOSGQuat ( )

Returns a reference to the internal OSG Quat.

Definition at line 88 of file Quat.cpp.

References mQuat.

◆ GetOSGQuat() [2/2]

const osg::Quat & trBase::Quat::GetOSGQuat ( ) const

Returns a reference to the internal OSG Quat.

Definition at line 94 of file Quat.cpp.

References mQuat.

◆ GetRotate() [1/3]

void trBase::Quat::GetRotate ( value_type angle,
value_type x,
value_type y,
value_type z 
) const

Return the angle and vector components represented by the quaternion.

Parameters
[in,out]angleThe angle.
[in,out]xThe x to process.
[in,out]yThe y to process.
[in,out]zThe z to process.

Definition at line 277 of file Quat.cpp.

References mQuat.

◆ GetRotate() [2/3]

void trBase::Quat::GetRotate ( value_type angle,
Vec3f vec 
) const

Return the angle and vector represented by the quaternion.

Parameters
[in,out]angleThe angle.
[in,out]vecThe vector.

Definition at line 283 of file Quat.cpp.

References mQuat.

◆ GetRotate() [3/3]

void trBase::Quat::GetRotate ( value_type angle,
Vec3d vec 
) const

Return the angle and vector represented by the quaternion.

Parameters
[in,out]angleThe angle.
[in,out]vecThe vector.

Definition at line 289 of file Quat.cpp.

References mQuat.

◆ Inverse()

const trBase::Quat trBase::Quat::Inverse ( ) const

Multiplicative inverse method: q^(-1) = q^* /(q.q^*)

Returns
A const Quat.

Definition at line 229 of file Quat.cpp.

References Conj(), and Length2().

Referenced by operator/(), and operator/=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsZeroRotation()

bool trBase::Quat::IsZeroRotation ( ) const

return true if the Quat represents a zero rotation, and therefore can be ignored in computations.

Returns
True if zero rotation, false if not.

Definition at line 205 of file Quat.cpp.

References mQuat.

◆ Length()

Quat::value_type trBase::Quat::Length ( ) const

Length of the quaternion = sqrt( vec .

vec )

Returns
A value_type.

Definition at line 211 of file Quat.cpp.

References mQuat.

◆ Length2()

Quat::value_type trBase::Quat::Length2 ( ) const

(Length*Length) of the quaternion = vec .

vec.

Returns
A value_type.

Definition at line 217 of file Quat.cpp.

References mQuat.

Referenced by Inverse().

Here is the caller graph for this function:

◆ MakeRotate() [1/7]

void trBase::Quat::MakeRotate ( value_type  angle,
value_type  x,
value_type  y,
value_type  z 
)

Set a quaternion which will perform a rotation of an angle around the axis given by the vector(x, y, z).

Parameters
angleThe angle.
xThe x to process.
yThe y to process.
zThe z to process.

Definition at line 235 of file Quat.cpp.

References mQuat.

◆ MakeRotate() [2/7]

void trBase::Quat::MakeRotate ( value_type  angle,
const Vec3f vec 
)

Set a quaternion which will perform a rotation of an angle around the axis given by the vector(x, y, z).

Parameters
angleThe angle.
vecThe vector.

Definition at line 241 of file Quat.cpp.

References mQuat.

◆ MakeRotate() [3/7]

void trBase::Quat::MakeRotate ( value_type  angle,
const Vec3d vec 
)

Set a quaternion which will perform a rotation of an angle around the axis given by the vector(x, y, z).

Parameters
angleThe angle.
vecThe vector.

Definition at line 247 of file Quat.cpp.

References mQuat.

◆ MakeRotate() [4/7]

void trBase::Quat::MakeRotate ( value_type  angle1,
const Vec3f axis1,
value_type  angle2,
const Vec3f axis2,
value_type  angle3,
const Vec3f axis3 
)

Set a quaternion which will perform a rotation of an angles around three axes given by the vectors(x, y, z).

Creates a quaternion after making three individual quaternions, one for each angle and axis, and multiplying them together. Q = q(angle1, axis1)*q(angle2, axis2)*q(angle3, axis3)

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.

Definition at line 253 of file Quat.cpp.

References mQuat.

◆ MakeRotate() [5/7]

void trBase::Quat::MakeRotate ( value_type  angle1,
const Vec3d axis1,
value_type  angle2,
const Vec3d axis2,
value_type  angle3,
const Vec3d axis3 
)

Set a quaternion which will perform a rotation of an angles around three axes given by the vectors(x, y, z).

Creates a quaternion after making three individual quaternions, one for each angle and axis, and multiplying them together. Q = q(angle1, axis1)*q(angle2, axis2)*q(angle3, axis3)

Parameters
angle1The first angle.
axis1The first axis.
angle2The second angle.
axis2The second axis.
angle3The third angle.
axis3The third axis.

Definition at line 259 of file Quat.cpp.

References mQuat.

◆ MakeRotate() [6/7]

void trBase::Quat::MakeRotate ( const Vec3f vec1,
const Vec3f vec2 
)

Make a rotation Quat which will rotate vec1 to vec2.

Watch out for the two special cases when the vectors are co-incident or opposite in direction. This routine uses only fast geometric transforms, without costly acos/sin computations. It's exact, fast, and with less degenerate cases than the acos/sin method.

For an explanation of the math used, you may see for example: http://logiciels.cnes.fr/MARMOTTES/marmottes-mathematique.pdf

Parameters
vec1The first vector.
vec2The second vector.

Definition at line 265 of file Quat.cpp.

References mQuat.

◆ MakeRotate() [7/7]

void trBase::Quat::MakeRotate ( const Vec3d vec1,
const Vec3d vec2 
)

Make a rotation Quat which will rotate vec1 to vec2.

Watch out for the two special cases when the vectors are co-incident or opposite in direction. This routine uses only fast geometric transforms, without costly acos/sin computations. It's exact, fast, and with less degenerate cases than the acos/sin method.

For an explanation of the math used, you may see for example: http://logiciels.cnes.fr/MARMOTTES/marmottes-mathematique.pdf

Parameters
vec1The first vector.
vec2The second vector.

Definition at line 271 of file Quat.cpp.

References mQuat.

◆ operator const osg::Quat &()

trBase::Quat::operator const osg::Quat & ( ) const

Implicit conversion operator to OSG Quaternion.

Definition at line 559 of file Quat.cpp.

References mQuat.

◆ operator osg::Quat()

trBase::Quat::operator osg::Quat ( ) const

Implicit conversion operator to OSG Quaternion.

Definition at line 547 of file Quat.cpp.

References mQuat.

◆ operator osg::Quat &()

trBase::Quat::operator osg::Quat & ( )

Implicit conversion operator to OSG Quaternion.

Definition at line 553 of file Quat.cpp.

References mQuat.

◆ operator osg::Quat *()

trBase::Quat::operator osg::Quat * ( )

Implicit conversion operator to OSG Quaternion.

Definition at line 565 of file Quat.cpp.

References mQuat.

◆ operator!=()

bool trBase::Quat::operator!= ( const Quat v) const

Not equals operator.

Definition at line 380 of file Quat.cpp.

References mQuat.

◆ operator*() [1/4]

const Quat trBase::Quat::operator* ( value_type  rhs) const

Multiply by scalar.

Definition at line 410 of file Quat.cpp.

References mQuat, and Quat().

Here is the call graph for this function:

◆ operator*() [2/4]

Vec3f trBase::Quat::operator* ( const Vec3f v) const

Rotate a vector by this quaternion.

Definition at line 416 of file Quat.cpp.

References mQuat.

◆ operator*() [3/4]

Vec3d trBase::Quat::operator* ( const Vec3d v) const

Rotate a vector by this quaternion.

Definition at line 429 of file Quat.cpp.

References mQuat.

◆ operator*() [4/4]

const Quat trBase::Quat::operator* ( const Quat rhs) const

Binary multiply.

Definition at line 452 of file Quat.cpp.

References mQuat, and Quat().

Here is the call graph for this function:

◆ operator*=() [1/2]

Quat & trBase::Quat::operator*= ( value_type  rhs)

Unary multiply by scalar.

Definition at line 442 of file Quat.cpp.

References mQuat.

◆ operator*=() [2/2]

Quat & trBase::Quat::operator*= ( const Quat rhs)

Unary multiply.

Definition at line 461 of file Quat.cpp.

References mQuat.

◆ operator+()

const Quat trBase::Quat::operator+ ( const Quat rhs) const

Binary addition.

Definition at line 507 of file Quat.cpp.

References mQuat, and Quat().

Here is the call graph for this function:

◆ operator+=()

Quat & trBase::Quat::operator+= ( const Quat rhs)

Unary addition.

Definition at line 514 of file Quat.cpp.

References mQuat.

◆ operator-() [1/2]

const Quat trBase::Quat::operator- ( const Quat rhs) const

Binary subtraction.

Definition at line 524 of file Quat.cpp.

References mQuat, and Quat().

Here is the call graph for this function:

◆ operator-() [2/2]

const Quat trBase::Quat::operator- ( ) const

Negation operator - returns the negative of the quaternion.

Basically just calls operator - () on the Vec4

Definition at line 541 of file Quat.cpp.

References mQuat, and Quat().

Here is the call graph for this function:

◆ operator-=()

Quat & trBase::Quat::operator-= ( const Quat rhs)

Unary subtraction.

Definition at line 531 of file Quat.cpp.

References mQuat.

◆ operator/() [1/2]

Quat trBase::Quat::operator/ ( value_type  rhs) const

Divide by scalar.

Definition at line 476 of file Quat.cpp.

References mQuat, and Quat().

Here is the call graph for this function:

◆ operator/() [2/2]

const Quat trBase::Quat::operator/ ( const Quat denom) const

Binary divide.

Definition at line 494 of file Quat.cpp.

References Inverse().

Here is the call graph for this function:

◆ operator/=() [1/2]

Quat & trBase::Quat::operator/= ( value_type  rhs)

Unary divide by scalar.

Definition at line 483 of file Quat.cpp.

References mQuat.

◆ operator/=() [2/2]

Quat & trBase::Quat::operator/= ( const Quat denom)

Unary divide.

Definition at line 500 of file Quat.cpp.

References Inverse().

Here is the call graph for this function:

◆ operator<()

bool trBase::Quat::operator< ( const Quat v) const

Less than operator.

Definition at line 386 of file Quat.cpp.

References mQuat.

◆ operator=()

Quat & trBase::Quat::operator= ( const Quat v)

Set operator.

Definition at line 367 of file Quat.cpp.

References mQuat.

◆ operator==()

bool trBase::Quat::operator== ( const Quat v) const

Equals operator.

Definition at line 374 of file Quat.cpp.

References mQuat.

◆ operator>()

bool trBase::Quat::operator> ( const Quat v) const

Greater than operator.

Definition at line 398 of file Quat.cpp.

References mQuat.

◆ operator[]() [1/2]

Quat::value_type & trBase::Quat::operator[] ( int  i)

Index operator.

Definition at line 355 of file Quat.cpp.

References mQuat.

◆ operator[]() [2/2]

Quat::value_type trBase::Quat::operator[] ( int  i) const

Index operator.

Definition at line 361 of file Quat.cpp.

References mQuat.

◆ Set() [1/9]

void trBase::Quat::Set ( const Quat q)

Sets the given q.

Parameters
[in,out]qThe q to set.

Definition at line 112 of file Quat.cpp.

References mQuat, W(), X(), Y(), and Z().

Here is the call graph for this function:

◆ Set() [2/9]

void trBase::Quat::Set ( const osg::Quat &  q)

Sets the given q.

Parameters
[in,out]qThe q to set.

Definition at line 121 of file Quat.cpp.

References mQuat.

◆ Set() [3/9]

void trBase::Quat::Set ( value_type  x,
value_type  y,
value_type  z,
value_type  w 
)

Sets.

Parameters
xThe x to process.
yThe y to process.
zThe z to process.
wThe w to process.

Definition at line 130 of file Quat.cpp.

References mQuat.

◆ Set() [4/9]

void trBase::Quat::Set ( const Vec4f v)

Sets the given v.

Parameters
vThe v to set.

Definition at line 139 of file Quat.cpp.

References mQuat, trBase::Vec4f::W(), trBase::Vec4f::X(), trBase::Vec4f::Y(), and trBase::Vec4f::Z().

Here is the call graph for this function:

◆ Set() [5/9]

void trBase::Quat::Set ( const Vec4d v)

Sets the given v.

Parameters
vThe v to set.

Definition at line 148 of file Quat.cpp.

References mQuat, trBase::Vec4d::W(), trBase::Vec4d::X(), trBase::Vec4d::Y(), and trBase::Vec4d::Z().

Here is the call graph for this function:

◆ Set() [6/9]

void trBase::Quat::Set ( const Matrixf matrix)

Sets the quaternion from the given matrix.

Definition at line 157 of file Quat.cpp.

References mQuat.

◆ Set() [7/9]

void trBase::Quat::Set ( const Matrixd matrix)

Sets the quaternion from the given matrix.

Definition at line 163 of file Quat.cpp.

References mQuat.

◆ Set() [8/9]

void trBase::Quat::Set ( const osg::Matrixf &  matrix)

Sets the given matrix.

Parameters
matrixThe matrix to set.

Definition at line 181 of file Quat.cpp.

References mQuat.

◆ Set() [9/9]

void trBase::Quat::Set ( const osg::Matrixd &  matrix)

Sets the given matrix.

Parameters
matrixThe matrix to set.

Definition at line 187 of file Quat.cpp.

References mQuat.

◆ Slerp()

void trBase::Quat::Slerp ( value_type  t,
const Quat from,
const Quat to 
)

Spherical Linear Interpolation.

As t goes from 0 to 1, the Quat object goes from "from" to "to".

Parameters
tThe value_type to process.
fromSource for the.
toto.

Definition at line 301 of file Quat.cpp.

References mQuat.

◆ ToString()

std::string trBase::Quat::ToString ( int  precision = -1)

Convert this object into a string representation.

Parameters
precision(Optional) The precision.
Returns
A std::string that represents this object.

Definition at line 571 of file Quat.cpp.

References mQuat.

◆ W() [1/2]

Quat::value_type & trBase::Quat::W ( )

Returns the W component of the quaternion/.

Definition at line 325 of file Quat.cpp.

References mQuat.

Referenced by trBase::operator<<(), and Set().

Here is the caller graph for this function:

◆ W() [2/2]

Quat::value_type trBase::Quat::W ( ) const

Returns the W component of the quaternion/.

Definition at line 349 of file Quat.cpp.

References mQuat.

◆ X() [1/2]

Quat::value_type & trBase::Quat::X ( )

Returns the X component of the quaternion/.

Definition at line 307 of file Quat.cpp.

References mQuat.

Referenced by trBase::operator<<(), and Set().

Here is the caller graph for this function:

◆ X() [2/2]

Quat::value_type trBase::Quat::X ( ) const

Returns the X component of the quaternion/.

Definition at line 331 of file Quat.cpp.

References mQuat.

◆ Y() [1/2]

Quat::value_type & trBase::Quat::Y ( )

Returns the Y component of the quaternion/.

Definition at line 313 of file Quat.cpp.

References mQuat.

Referenced by trBase::operator<<(), and Set().

Here is the caller graph for this function:

◆ Y() [2/2]

Quat::value_type trBase::Quat::Y ( ) const

Returns the Y component of the quaternion/.

Definition at line 337 of file Quat.cpp.

References mQuat.

◆ Z() [1/2]

Quat::value_type & trBase::Quat::Z ( )

Returns the Z component of the quaternion/.

Definition at line 319 of file Quat.cpp.

References mQuat.

Referenced by trBase::operator<<(), and Set().

Here is the caller graph for this function:

◆ Z() [2/2]

Quat::value_type trBase::Quat::Z ( ) const

Returns the Z component of the quaternion/.

Definition at line 343 of file Quat.cpp.

References mQuat.

Member Data Documentation

◆ mQuat


The documentation for this class was generated from the following files: