Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::Transform Class Reference

Component class for any object that requires space transformations. More...

#include <aeongames/Transform.hpp>

Collaboration diagram for AeonGames::Transform:
Collaboration graph

Public Member Functions

DLL Transform (const Vector3 &aScale, const Quaternion &aRotation, const Vector3 &aTranslation)
 Construct from scale, rotation quaternion, and translation.
DLL Transform (const Vector3 &aScale, const Vector3 &aRotation, const Vector3 &aTranslation)
 Construct from scale, rotation Euler angles, and translation.
DLL Transform (const float *aData)
 Construct from a float array.
DLL void Get (float *aData) const
 Copy the transform data to a float array.
DLL const Vector3GetScale () const
 Get the scale vector.
DLL const QuaternionGetRotation () const
 Get the rotation quaternion.
DLL const Vector3GetTranslation () const
 Get the translation vector.
DLL void SetScale (const Vector3 &aScale)
 Set transform scale vector.
DLL void SetRotation (const Quaternion &aRotation)
 Set the rotation quaternion.
DLL void SetTranslation (const Vector3 &aTranslation)
 Set the translation vector.
DLL void Move (float x, float y, float z)
 Adds the provided vector to the position vector.
DLL void MoveInObjectSpace (float x, float y, float z)
 Moves the transfrom relative to its own axes.
DLL void RotateObjectSpace (float angle, float x, float y, float z)
 Rotate in Object Space.
DLL void RotateInertialSpace (float angle, float x, float y, float z)
 Rotate in Inertial Space.
DLL void ResetRotation ()
 Clear rotation.
DLL const Matrix4x4 GetMatrix () const
 Constructs a transformation matrix from the SRT variables.
DLL const Matrix3x3 GetScaleRotationMatrix () const
 Constructs a transformation matrix from only the SR variables.
DLL const Matrix4x4 GetInvertedMatrix () const
 Constructs an inverted transformation matrix from the SRT variables.
DLL Transform & Invert ()
 Invert this transform in place.
DLL const Transform GetInverted () const
 Get the inverted transform.

Operators

Vector3 mScale {1, 1, 1}
 Scale rotation and translation.
Quaternion mRotation {1, 0, 0, 0}
 Rotation quaternion.
Vector3 mTranslation {0, 0, 0}
 Translation vector.
DLL Transform & operator*= (const Transform &lhs)
 Combine this transform with another transform.

Detailed Description

Component class for any object that requires space transformations.

Definition at line 33 of file Transform.hpp.

Constructor & Destructor Documentation

◆ Transform() [1/3]

AeonGames::Transform::Transform ( const Vector3 & aScale,
const Quaternion & aRotation,
const Vector3 & aTranslation )

Construct from scale, rotation quaternion, and translation.

Parameters
aScaleThe scale vector.
aRotationThe rotation quaternion.
aTranslationThe translation vector.

Definition at line 27 of file Transform.cpp.

◆ Transform() [2/3]

AeonGames::Transform::Transform ( const Vector3 & aScale,
const Vector3 & aRotation,
const Vector3 & aTranslation )

Construct from scale, rotation Euler angles, and translation.

Parameters
aScaleThe scale vector.
aRotationThe rotation as Euler angles in degrees.
aTranslationThe translation vector.

Definition at line 32 of file Transform.cpp.

◆ Transform() [3/3]

AeonGames::Transform::Transform ( const float * aData)

Construct from a float array.

Parameters
aDataPointer to a float array containing scale, rotation, and translation data.

Definition at line 37 of file Transform.cpp.

Member Function Documentation

◆ Get()

void AeonGames::Transform::Get ( float * aData) const

Copy the transform data to a float array.

Parameters
aDataPointer to a float array to receive the transform data.

Definition at line 42 of file Transform.cpp.

◆ GetInverted()

const Transform AeonGames::Transform::GetInverted ( ) const

Get the inverted transform.

Returns
A new Transform that is the inverse of this transform.

Definition at line 173 of file Transform.cpp.

◆ GetInvertedMatrix()

const Matrix4x4 AeonGames::Transform::GetInvertedMatrix ( ) const

Constructs an inverted transformation matrix from the SRT variables.

Returns
Inverted transformation matrix.
Note
This matrix is useful as a view matrix.

Definition at line 150 of file Transform.cpp.

◆ GetMatrix()

const Matrix4x4 AeonGames::Transform::GetMatrix ( ) const

Constructs a transformation matrix from the SRT variables.

Returns
Transformation matrix.

Definition at line 102 of file Transform.cpp.

◆ GetRotation()

const Quaternion & AeonGames::Transform::GetRotation ( ) const

Get the rotation quaternion.

Returns
Const reference to the rotation quaternion.

Definition at line 53 of file Transform.cpp.

◆ GetScale()

const Vector3 & AeonGames::Transform::GetScale ( ) const

Get the scale vector.

Returns
Const reference to the scale vector.

Definition at line 49 of file Transform.cpp.

◆ GetScaleRotationMatrix()

const Matrix3x3 AeonGames::Transform::GetScaleRotationMatrix ( ) const

Constructs a transformation matrix from only the SR variables.

Returns
3x3 transformation matrix.

Definition at line 130 of file Transform.cpp.

◆ GetTranslation()

const Vector3 & AeonGames::Transform::GetTranslation ( ) const

Get the translation vector.

Returns
Const reference to the translation vector.

Definition at line 57 of file Transform.cpp.

◆ Invert()

Transform & AeonGames::Transform::Invert ( )

Invert this transform in place.

Returns
Reference to this transform after inversion.

Definition at line 160 of file Transform.cpp.

◆ Move()

void AeonGames::Transform::Move ( float x,
float y,
float z )

Adds the provided vector to the position vector.

Parameters
x[in] X move vector value.
y[in] Y move vector value.
z[in] Z move vector value.

Definition at line 87 of file Transform.cpp.

◆ MoveInObjectSpace()

void AeonGames::Transform::MoveInObjectSpace ( float x,
float y,
float z )

Moves the transfrom relative to its own axes.

Parameters
x[in] X move vector value.
y[in] Y move vector value.
z[in] Z move vector value.

Definition at line 155 of file Transform.cpp.

◆ operator*=()

Transform & AeonGames::Transform::operator*= ( const Transform & lhs)

Combine this transform with another transform.

Definition at line 178 of file Transform.cpp.

◆ ResetRotation()

void AeonGames::Transform::ResetRotation ( )

Clear rotation.

Definition at line 94 of file Transform.cpp.

◆ RotateInertialSpace()

void AeonGames::Transform::RotateInertialSpace ( float angle,
float x,
float y,
float z )

Rotate in Inertial Space.

Parameters
angle[in] Angle in degrees of rotation.
x[in] X element of axis of rotation.
y[in] Y element of axis of rotation.
z[in] Z element of axis of rotation.

Definition at line 82 of file Transform.cpp.

◆ RotateObjectSpace()

void AeonGames::Transform::RotateObjectSpace ( float angle,
float x,
float y,
float z )

Rotate in Object Space.

Parameters
angle[in] Angle in degrees of rotation.
x[in] X element of axis of rotation.
y[in] Y element of axis of rotation.
z[in] Z element of axis of rotation.

Definition at line 77 of file Transform.cpp.

◆ SetRotation()

void AeonGames::Transform::SetRotation ( const Quaternion & aRotation)

Set the rotation quaternion.

Parameters
aRotationThe new rotation quaternion.

Definition at line 67 of file Transform.cpp.

◆ SetScale()

void AeonGames::Transform::SetScale ( const Vector3 & aScale)

Set transform scale vector.

Definition at line 62 of file Transform.cpp.

◆ SetTranslation()

void AeonGames::Transform::SetTranslation ( const Vector3 & aTranslation)

Set the translation vector.

Parameters
aTranslationThe new translation vector.

Definition at line 72 of file Transform.cpp.

Member Data Documentation

◆ mRotation

Quaternion AeonGames::Transform::mRotation {1, 0, 0, 0}
protected

Rotation quaternion.

Definition at line 155 of file Transform.hpp.

◆ mScale

Vector3 AeonGames::Transform::mScale {1, 1, 1}
protected

Scale rotation and translation.

Definition at line 154 of file Transform.hpp.

◆ mTranslation

Vector3 AeonGames::Transform::mTranslation {0, 0, 0}
protected

Translation vector.

Definition at line 156 of file Transform.hpp.


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