Overload  1.1
Game engine with editor
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
OvMaths::FQuaternion Struct Reference

#include <FQuaternion.h>

Public Member Functions

 FQuaternion ()
 
 FQuaternion (float p_real)
 
 FQuaternion (float p_x, float p_y, float p_z, float p_w)
 
 FQuaternion (const FQuaternion &p_other)
 
 FQuaternion (const FMatrix3 &p_rotationMatrix)
 
 FQuaternion (const FMatrix4 &p_rotationMatrix)
 
 FQuaternion (const FVector3 &p_euler)
 
bool operator== (const FQuaternion &p_otherQuat) const
 
bool operator!= (const FQuaternion &p_otherQuat) const
 
FQuaternion operator+ (const FQuaternion &p_otherQuat) const
 
FQuaternionoperator+= (const FQuaternion &p_otherQuat)
 
FQuaternion operator- (const FQuaternion &p_otherQuat) const
 
FQuaternionoperator-= (const FQuaternion &p_otherQuat)
 
float operator| (const FQuaternion &p_otherQuat) const
 
FQuaternionoperator*= (const float p_scale)
 
FQuaternion operator* (const float p_scale) const
 
FQuaternion operator* (const FQuaternion &p_otherQuat) const
 
FQuaternionoperator*= (const FQuaternion &p_otherQuat)
 
FVector3 operator* (const FVector3 &p_toMultiply) const
 
FMatrix3 operator* (const FMatrix3 &p_multiply) const
 
FQuaternionoperator/= (const float p_scale)
 
FQuaternion operator/ (const float p_scale) const
 

Static Public Member Functions

static FQuaternion Identity ()
 
static bool IsIdentity (const FQuaternion &p_target)
 
static bool IsPure (const FQuaternion &p_target)
 
static bool IsNormalized (const FQuaternion &p_target)
 
static float DotProduct (const FQuaternion &p_left, const FQuaternion &p_right)
 
static FQuaternion Normalize (const FQuaternion &p_target)
 
static float Length (const FQuaternion &p_target)
 
static float LengthSquare (const FQuaternion &p_target)
 
static float GetAngle (const FQuaternion &p_target)
 
static FVector3 GetRotationAxis (const FQuaternion &p_target)
 
static FQuaternion Inverse (const FQuaternion &p_target)
 
static FQuaternion Conjugate (const FQuaternion &p_target)
 
static FQuaternion Square (const FQuaternion &p_target)
 
static std::pair< FVector3, float > GetAxisAndAngle (const FQuaternion &p_target)
 
static float AngularDistance (const FQuaternion &p_left, const FQuaternion &p_right)
 
static FQuaternion Lerp (const FQuaternion &p_start, const FQuaternion &p_end, float p_alpha)
 
static FQuaternion Slerp (const FQuaternion &p_start, const FQuaternion &p_end, float p_alpha)
 
static FQuaternion Nlerp (const FQuaternion &p_start, const FQuaternion &p_end, float p_alpha)
 
static FVector3 RotatePoint (const FVector3 &p_point, const FQuaternion &p_quaternion)
 
static FVector3 RotatePoint (const FVector3 &p_point, const FQuaternion &p_quaternion, const FVector3 &p_pivot)
 
static FVector3 EulerAngles (const FQuaternion &p_target)
 
static FMatrix3 ToMatrix3 (const FQuaternion &p_target)
 
static FMatrix4 ToMatrix4 (const FQuaternion &p_target)
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Detailed Description

Mathematic representation of a Quaternion with float precision

Constructor & Destructor Documentation

◆ FQuaternion() [1/7]

OvMaths::FQuaternion::FQuaternion ( )

Default Quaternion constructor (Create an identity quaternion with 1 as w)

◆ FQuaternion() [2/7]

OvMaths::FQuaternion::FQuaternion ( float  p_real)

Create an identity quaternion with a defined real value

Parameters
p_real

◆ FQuaternion() [3/7]

OvMaths::FQuaternion::FQuaternion ( float  p_x,
float  p_y,
float  p_z,
float  p_w 
)

Create a quaternion from a set of 4 floats (x, y, z, w)

Parameters
p_xVector part of FQuaternion
p_yVector part of FQuaternion
p_zVector part of FQuaternion
p_wReal value of FQuaternion
Note
In pure/applied Maths, we write W (or real), (Xi + Yj + Zk) (or Vector)

◆ FQuaternion() [4/7]

OvMaths::FQuaternion::FQuaternion ( const FQuaternion p_other)

Copy Constructor

Parameters
p_other

◆ FQuaternion() [5/7]

OvMaths::FQuaternion::FQuaternion ( const FMatrix3 p_rotationMatrix)

Construct from rotation matrix

Parameters
p_rotationMatrix

◆ FQuaternion() [6/7]

OvMaths::FQuaternion::FQuaternion ( const FMatrix4 p_rotationMatrix)

Construct from rotation matrix

Parameters
p_rotationMatrix

◆ FQuaternion() [7/7]

OvMaths::FQuaternion::FQuaternion ( const FVector3 p_euler)

Construct from euler angles

Parameters
p_euler

Member Function Documentation

◆ AngularDistance()

float OvMaths::FQuaternion::AngularDistance ( const FQuaternion p_left,
const FQuaternion p_right 
)
static

Caculate the angle between two quaternions.

Parameters
p_left
p_right

◆ Conjugate()

OvMaths::FQuaternion OvMaths::FQuaternion::Conjugate ( const FQuaternion p_target)
static

Calculate the conjugate of a quaternion

Parameters
p_target

◆ DotProduct()

float OvMaths::FQuaternion::DotProduct ( const FQuaternion p_left,
const FQuaternion p_right 
)
static

Calculate the dot product between two quaternions

Parameters
p_left
p_right

◆ EulerAngles()

OvMaths::FVector3 OvMaths::FQuaternion::EulerAngles ( const FQuaternion p_target)
static

Returning Euler axis angles (In degrees) for each axis.

Parameters
p_target

◆ GetAngle()

float OvMaths::FQuaternion::GetAngle ( const FQuaternion p_target)
static

Return the angle of a quaternion

Parameters
p_target

◆ GetAxisAndAngle()

std::pair< OvMaths::FVector3, float > OvMaths::FQuaternion::GetAxisAndAngle ( const FQuaternion p_target)
static

Get the axis and the angle from a quaternion

Parameters
p_axis
p_angle

◆ GetRotationAxis()

OvMaths::FVector3 OvMaths::FQuaternion::GetRotationAxis ( const FQuaternion p_target)
static

Return the rotation axis of the given quaternion

Parameters
p_target

◆ Identity()

OvMaths::FQuaternion OvMaths::FQuaternion::Identity ( )
static

Return an identity quaternion

◆ Inverse()

OvMaths::FQuaternion OvMaths::FQuaternion::Inverse ( const FQuaternion p_target)
static

Calculate the inverse of a quaternion

Parameters
p_target

◆ IsIdentity()

bool OvMaths::FQuaternion::IsIdentity ( const FQuaternion p_target)
static

Check if the quaternion is Identity if the quaternion has no rotation(meaning x,y,z axis values = 0), it's Identity

Parameters
p_target

◆ IsNormalized()

bool OvMaths::FQuaternion::IsNormalized ( const FQuaternion p_target)
static

Check if the quaternion is normalized

Parameters
p_target

◆ IsPure()

bool OvMaths::FQuaternion::IsPure ( const FQuaternion p_target)
static

◆ Length()

float OvMaths::FQuaternion::Length ( const FQuaternion p_target)
static

Calculate the length of a quaternion

Parameters
p_target

◆ LengthSquare()

float OvMaths::FQuaternion::LengthSquare ( const FQuaternion p_target)
static

Calculate the length square of a quaternion

Parameters
p_target

◆ Lerp()

OvMaths::FQuaternion OvMaths::FQuaternion::Lerp ( const FQuaternion p_start,
const FQuaternion p_end,
float  p_alpha 
)
static

Lerp two quaternions

Parameters
p_start
p_end
p_alpha

◆ Nlerp()

OvMaths::FQuaternion OvMaths::FQuaternion::Nlerp ( const FQuaternion p_start,
const FQuaternion p_end,
float  p_alpha 
)
static

Nlerp two quaternions (= Lerp + normalization)

Parameters
p_start
p_end
p_alpha

◆ Normalize()

OvMaths::FQuaternion OvMaths::FQuaternion::Normalize ( const FQuaternion p_target)
static

Calculate the normalized of a quaternion

Parameters
p_target

◆ operator!=()

bool OvMaths::FQuaternion::operator!= ( const FQuaternion p_otherQuat) const

◆ operator*() [1/4]

OvMaths::FQuaternion OvMaths::FQuaternion::operator* ( const float  p_scale) const

◆ operator*() [2/4]

OvMaths::FMatrix3 OvMaths::FQuaternion::operator* ( const FMatrix3 p_multiply) const

◆ operator*() [3/4]

OvMaths::FQuaternion OvMaths::FQuaternion::operator* ( const FQuaternion p_otherQuat) const

◆ operator*() [4/4]

OvMaths::FVector3 OvMaths::FQuaternion::operator* ( const FVector3 p_toMultiply) const

◆ operator*=() [1/2]

OvMaths::FQuaternion & OvMaths::FQuaternion::operator*= ( const float  p_scale)

◆ operator*=() [2/2]

OvMaths::FQuaternion & OvMaths::FQuaternion::operator*= ( const FQuaternion p_otherQuat)

◆ operator+()

OvMaths::FQuaternion OvMaths::FQuaternion::operator+ ( const FQuaternion p_otherQuat) const

◆ operator+=()

OvMaths::FQuaternion & OvMaths::FQuaternion::operator+= ( const FQuaternion p_otherQuat)

◆ operator-()

OvMaths::FQuaternion OvMaths::FQuaternion::operator- ( const FQuaternion p_otherQuat) const

◆ operator-=()

OvMaths::FQuaternion & OvMaths::FQuaternion::operator-= ( const FQuaternion p_otherQuat)

◆ operator/()

OvMaths::FQuaternion OvMaths::FQuaternion::operator/ ( const float  p_scale) const

◆ operator/=()

OvMaths::FQuaternion & OvMaths::FQuaternion::operator/= ( const float  p_scale)

◆ operator==()

bool OvMaths::FQuaternion::operator== ( const FQuaternion p_otherQuat) const

◆ operator|()

float OvMaths::FQuaternion::operator| ( const FQuaternion p_otherQuat) const

◆ RotatePoint() [1/2]

OvMaths::FVector3 OvMaths::FQuaternion::RotatePoint ( const FVector3 p_point,
const FQuaternion p_quaternion 
)
static

Rotate a point using a rotation quaternion (qpq^-1)

Parameters
p_point
p_quaternion

◆ RotatePoint() [2/2]

OvMaths::FVector3 OvMaths::FQuaternion::RotatePoint ( const FVector3 p_point,
const FQuaternion p_quaternion,
const FVector3 p_pivot 
)
static

Rotate a point around a pivot point using a rotation quaternion

Parameters
p_point
p_pivot
p_quaternion

◆ Slerp()

OvMaths::FQuaternion OvMaths::FQuaternion::Slerp ( const FQuaternion p_start,
const FQuaternion p_end,
float  p_alpha 
)
static

Slerp two quaternions

Parameters
p_first
p_second
p_alpha

◆ Square()

OvMaths::FQuaternion OvMaths::FQuaternion::Square ( const FQuaternion p_target)
static

Calculate the square of a quaternion

Parameters
p_target

◆ ToMatrix3()

OvMaths::FMatrix3 OvMaths::FQuaternion::ToMatrix3 ( const FQuaternion p_target)
static

Return a rotation matrix (3x3) out of the given quaternion

Parameters
p_target

◆ ToMatrix4()

OvMaths::FMatrix4 OvMaths::FQuaternion::ToMatrix4 ( const FQuaternion p_target)
static

Return a rotation matrix (4x4) out of the given quaternion

Parameters
p_target

Member Data Documentation

◆ w

float OvMaths::FQuaternion::w

◆ x

float OvMaths::FQuaternion::x

◆ y

float OvMaths::FQuaternion::y

◆ z

float OvMaths::FQuaternion::z

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