TrinityCore
QuaternionData Struct Reference

#include <QuaternionData.h>

Public Member Functions

 QuaternionData ()
 
 QuaternionData (float X, float Y, float Z, float W)
 
bool isUnit () const
 

Static Public Member Functions

static QuaternionData fromEulerAnglesZYX (float Z, float Y, float X)
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Friends

bool operator== (QuaternionData const &left, QuaternionData const &right)
 
bool operator!= (QuaternionData const &left, QuaternionData const &right)
 

Constructor & Destructor Documentation

◆ QuaternionData() [1/2]

QuaternionData::QuaternionData ( )
inline
27  : x(0.0f), y(0.0f), z(0.0f), w(1.0f)
28  {
29  }
float y
Definition: QuaternionData.h:25
float z
Definition: QuaternionData.h:25
float w
Definition: QuaternionData.h:25
float x
Definition: QuaternionData.h:25

◆ QuaternionData() [2/2]

QuaternionData::QuaternionData ( float  X,
float  Y,
float  Z,
float  W 
)
inline
30  : x(X), y(Y), z(Z), w(W)
31  {
32  }
float y
Definition: QuaternionData.h:25
float z
Definition: QuaternionData.h:25
float w
Definition: QuaternionData.h:25
float x
Definition: QuaternionData.h:25

Member Function Documentation

◆ fromEulerAnglesZYX()

QuaternionData QuaternionData::fromEulerAnglesZYX ( float  Z,
float  Y,
float  X 
)
static
102 {
103  G3D::Quat quat(G3D::Matrix3::fromEulerAnglesZYX(Z, Y, X));
104  return QuaternionData(quat.x, quat.y, quat.z, quat.w);
105 }
QuaternionData()
Definition: QuaternionData.h:27
+ Here is the caller graph for this function:

◆ isUnit()

bool QuaternionData::isUnit ( ) const
97 {
98  return fabs(x * x + y * y + z * z + w * w - 1.0f) < 1e-5f;
99 }
float y
Definition: QuaternionData.h:25
float z
Definition: QuaternionData.h:25
float w
Definition: QuaternionData.h:25
float x
Definition: QuaternionData.h:25
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( QuaternionData const &  left,
QuaternionData const &  right 
)
friend
43  {
44  return !(left == right);
45  }

◆ operator==

bool operator== ( QuaternionData const &  left,
QuaternionData const &  right 
)
friend
38  {
39  return left.x == right.x && left.y == right.y && left.z == right.z && left.w == right.w;
40  }

Member Data Documentation

◆ w

float QuaternionData::w

◆ x

float QuaternionData::x

◆ y

float QuaternionData::y

◆ z

float QuaternionData::z

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