 FQuat

Module 

Header 
/Engine/Source/Runtime/Core/Public/Math/Quat.h 
Include 
#include "Math/Quat.h" 
struct FQuat
Floating point quaternion that can represent a rotation about an axis in 3D space. The X, Y, Z, W components also double as the Axis/Angle format.
Order matters when composing quaternions: C = A * B will yield a quaternion C that logically first applies B then A to any subsequent transformation (right first, then left). Note that this is the opposite order of FTransform multiplication.
Example: LocalToWorld = (LocalToWorld * DeltaRotation) will change rotation in local space by DeltaRotation. Example: LocalToWorld = (DeltaRotation * LocalToWorld) will change rotation in world space by DeltaRotation.
Name  Description  

float 
W 
The quaternion's Wcomponent. 

float 
X 
The quaternion's Xcomponent. 

float 
Y 
The quaternion's Ycomponent. 

float 
Z 
The quaternion's Zcomponent. 
Name  Description  

FQuat() 
Default constructor (no initialization). 

FQuat ( 
Creates and initializes a new quaternion, with the W component either 0 or 1. 

FQuat ( 
Copy constructor. 

FQuat ( 
Creates and initializes a new quaternion from the given matrix. 

FQuat ( 
Creates and initializes a new quaternion from the given rotator. 

FQuat ( 
Creates and initializes a new quaternion from the a rotation around the given axis. 

FQuat ( 
Constructor. 
Name  Description  


float 
AngularDistance ( 
Find the angular distance between two rotation quaternions (in radians) 

void 
CalcTangents 
Calculate tangents between given points 

bool 
ContainsNaN() 
Utility to check if there are any nonfinite values (NaN or Inf) in this Quat. 

void 
DiagnosticCheckNaN ( 


void 
DiagnosticCheckNaN() 

void 
EnforceShortestArcWith ( 
Enforce that the delta between this Quaternion and another one represents the shortest possible rotation angle 


bool 
Equals ( 
Checks whether another Quaternion is equal to this, within specified tolerance. 

float 
Error 
Error measure (angle) between two quaternions, ranged [0..1]. 

float 
ErrorAutoNormalize 
FQuat::Error with autonormalization. 

Euler() 
Convert a Quaternion into floatingpoint Euler angles (in degrees). 


Exp() 
Exp should really only be used after Log. 


FastBilerp 
BiLinear Quaternion interpolation. Result is NOT normalized. 


FastLerp 
Fast Linear Quaternion Interpolation. Result is NOT normalized. 


FindBetween 
Generates the 'smallest' (geodesic) rotation between two vectors of arbitrary length. 


FindBetweenNormals 
Generates the 'smallest' (geodesic) rotation between two normals (assumed to be unit length). 


FindBetweenVectors 
Generates the 'smallest' (geodesic) rotation between two vectors of arbitrary length. 


float 
GetAngle() 
Get the angle of this quaternion 

GetAxisX() 
Get the forward direction (X axis) after it has been rotated by this Quaternion. 


GetAxisY() 
Get the right direction (Y axis) after it has been rotated by this Quaternion. 


GetAxisZ() 
Get the up direction (Z axis) after it has been rotated by this Quaternion. 


GetForwardVector() 
Get the forward direction (X axis) after it has been rotated by this Quaternion. 


GetNormalized ( 
Get a normalized copy of this quaternion. If it is too small, returns an identity quaternion. 


GetRightVector() 
Get the right direction (Y axis) after it has been rotated by this Quaternion. 


GetRotationAxis() 
Get the axis of rotation of the Quaternion. 


GetUpVector() 
Get the up direction (Z axis) after it has been rotated by this Quaternion. 

bool 
InitFromString ( 


Inverse() 


bool 
IsIdentity ( 
Checks whether this Quaternion is an Identity Quaternion. Assumes Quaternion tested is normalized. 

bool 
IsNormalized() 
Return true if this quaternion is normalized. 

Log() 


MakeFromEuler ( 
Convert a vector of floatingpoint Euler angles (in degrees) into a Quaternion. 

bool 
NetSerialize ( 
Serializes the vector compressed for e.g. network transmission. 

void 
Normalize ( 
Normalize this quaternion if it is large enough. 


RotateVector ( 
Rotate a vector by this quaternion. 


Rotator() 
Get the FRotator representation of this Quaternion. 

bool 
Serialize ( 


float 
Size() 
Get the length of this quaternion. 

float 
SizeSquared() 
Get the length squared of this quaternion. 

Slerp 
Spherical interpolation. Will correct alignment. Result is normalized. 


Slerp_NotNormalized 
Spherical interpolation. Will correct alignment. Result is NOT normalized. 


SlerpFullPath 
Simpler Slerp that doesn't do any checks for 'shortest distance' etc. 


SlerpFullPath_NotNormalized 
Simpler Slerp that doesn't do any checks for 'shortest distance' etc. 


Squad 
Given start and end quaternions of quat1 and quat2, and tangents at those points tang1 and tang2, calculate the point at Alpha (between 0 and 1) between them. 


SquadFullPath 
Simpler Squad that doesn't do any checks for 'shortest distance' etc. 


void 
ToAxisAndAngle ( 
Get the axis and angle of rotation of this quaternion : assumes normalized quaternions. 

ToString() 
Get a textual representation of the vector. 


void 
ToSwingTwist 
Get the swing and twist decomposition for a specified axis 

UnrotateVector ( 
Rotate a vector by the inverse of this quaternion. 


Vector() 
Convert a rotation into a unit vector facing in its direction. 
Name  Description  


operator ( 
Gets the result of subtracting a Quaternion to this. 


bool 
operator!= ( 
Checks whether two quaternions are not identical. 

operator* ( 
Get the result of scaling this quaternion. 


operator* ( 
Multiply this by a matrix. 


operator* ( 
Rotate a vector by this quaternion. 


operator* ( 
Gets the result of multiplying this by another quaternion (this * Q). 

operator*= ( 
Multiply this quaternion by a scaling factor. 

operator*= ( 
Multiply this by a quaternion (this = this * Q). 


operator/ ( 
Divide this quaternion by scale. 

operator/= ( 
Divide this quaternion by scale. 


float 
operator ( 
Calculates dot product of two quaternions. 

operator+ ( 
Gets the result of adding a Quaternion to this. 

operator+= ( 
Adds to this quaternion. 

operator= ( 
Subtracts another quaternion from this. 


bool 
operator== ( 
Checks whether two quaternions are identical. 
Name 
Description 

Identity 
Identity quaternion. 