ezEngine Release 26.3
Loading...
Searching...
No Matches
ezSimdQuatd Class Reference

Public Member Functions

 EZ_DECLARE_POD_TYPE ()
 
 ezSimdQuatd (const ezSimdVec4d &v)
 
void Normalize ()
 Normalizes the quaternion to unit length. ALL rotation-quaternions should be normalized at all times (automatically).
 
ezResult GetRotationAxisAndAngle (ezSimdVec4d &ref_vAxis, ezSimdDouble &ref_fAngle, const ezSimdDouble &fEpsilon=ezMath::DefaultEpsilon< double >()) const
 Returns the rotation-axis and angle (in Radians), that this quaternion rotates around.
 
ezSimdMat4d GetAsMat4 () const
 Returns the Quaternion as a matrix.
 
bool IsValid (const ezSimdDouble &fEpsilon=ezMath::DefaultEpsilon< float >()) const
 Checks whether all components are neither NaN nor infinite and that the quaternion is normalized.
 
bool IsNaN () const
 Checks whether any component is NaN.
 
bool IsEqualRotation (const ezSimdQuatd &qOther, const ezSimdDouble &fEpsilon) const
 Determines whether this and qOther represent the same rotation. This is a rather slow operation.
 
ezSimdQuatd operator- () const
 Returns a Quaternion that represents the negative / inverted rotation.
 
ezSimdVec4d operator* (const ezSimdVec4d &v) const
 Rotates v by q.
 
ezSimdQuatd operator* (const ezSimdQuatd &q2) const
 Concatenates the rotations of q1 and q2.
 
bool operator== (const ezSimdQuatd &q2) const
 
bool operator!= (const ezSimdQuatd &q2) const
 

Static Public Member Functions

static const ezSimdQuatd MakeIdentity ()
 Static function that returns a quaternion that represents the identity rotation (none).
 
static ezSimdQuatd MakeFromElements (ezSimdDouble x, ezSimdDouble y, ezSimdDouble z, ezSimdDouble w)
 Sets the individual elements of the quaternion directly. Note that x,y,z do NOT represent a rotation axis, and w does NOT represent an angle.
 
static ezSimdQuatd MakeFromAxisAndAngle (const ezSimdVec4d &vRotationAxis, const ezSimdDouble &fAngle)
 Creates a quaternion from a rotation-axis and an angle (angle is given in Radians or as an ezAngle)
 
static ezSimdQuatd MakeShortestRotation (const ezSimdVec4d &vDirFrom, const ezSimdVec4d &vDirTo)
 Creates a quaternion, that rotates through the shortest arc from "vDirFrom" to "vDirTo".
 
static ezSimdQuatd MakeSlerp (const ezSimdQuatd &qFrom, const ezSimdQuatd &qTo, const ezSimdDouble &t)
 Returns a quaternion that is the spherical linear interpolation of the other two.
 

Public Attributes

ezSimdVec4d m_v
 

Member Function Documentation

◆ GetRotationAxisAndAngle()

ezResult ezSimdQuatd::GetRotationAxisAndAngle ( ezSimdVec4d ref_vAxis,
ezSimdDouble ref_fAngle,
const ezSimdDouble fEpsilon = ezMath::DefaultEpsilon<double>() 
) const
inline

Returns the rotation-axis and angle (in Radians), that this quaternion rotates around.

Todo:
optimize

◆ IsEqualRotation()

bool ezSimdQuatd::IsEqualRotation ( const ezSimdQuatd qOther,
const ezSimdDouble fEpsilon 
) const

Determines whether this and qOther represent the same rotation. This is a rather slow operation.

Currently it fails when one of the given quaternions is identity (so no rotation, at all), as it tries to compare rotation axis' and angles, which is undefined for the identity quaternion (also there are infinite representations for 'identity', so it's difficult to check for it).

◆ MakeFromAxisAndAngle()

ezSimdQuatd ezSimdQuatd::MakeFromAxisAndAngle ( const ezSimdVec4d vRotationAxis,
const ezSimdDouble fAngle 
)
inlinestatic

Creates a quaternion from a rotation-axis and an angle (angle is given in Radians or as an ezAngle)

Todo:
optimize

◆ MakeFromElements()

EZ_ALWAYS_INLINE ezSimdQuatd ezSimdQuatd::MakeFromElements ( ezSimdDouble  x,
ezSimdDouble  y,
ezSimdDouble  z,
ezSimdDouble  w 
)
static

Sets the individual elements of the quaternion directly. Note that x,y,z do NOT represent a rotation axis, and w does NOT represent an angle.

Use this function only if you have good understanding of quaternion math and know exactly what you are doing.


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