Clutter Engine 0.0.1
Loading...
Searching...
No Matches
Transform Class Reference

Represents a 3D transformation including translation, rotation, and scale. More...

#include <Transform.h>

Public Member Functions

 Transform ()
 Default constructor. Initializes to identity transform.
 
 Transform (Vector3 pLocation, Vector3 pScale, Quaternion pRotation)
 Constructs a transform with specified location, scale, and rotation.
 
Vector3 Right () const
 Gets the right direction vector in world space.
 
Vector3 Up () const
 Gets the up direction vector in world space.
 
Vector3 Forward () const
 Gets the forward direction vector in world space.
 
Vector3 TransformPosition (const Vector3 &localPosition) const
 Transforms a local position to world space.
 
Vector3 InverseTransformPosition (const Vector3 &worldPosition) const
 Transforms a world position to local space.
 
void SetLocation (Vector3 newLocation)
 Sets the location of the transform.
 
void SetLocation (Vector2 newLocation)
 Sets the location of the transform using a Vector2.
 
void SetRotation (Quaternion newRotation)
 Sets the rotation of the transform.
 
void SetRotation (Vector3 newRotation)
 Sets the rotation of the transform using Euler angles.
 
void AddRotation (Vector3 newRotation)
 Adds a rotation to the current rotation using Euler angles.
 
void SetRotation (float newRotation)
 Sets the rotation of the transform using a float (implementation dependent).
 
void SetScale (Vector3 newScale)
 Sets the scale of the transform.
 
void SetScale (Vector2 newScale)
 Sets the scale of the transform using a Vector2.
 
Transform operator+ (const Transform &q) const
 Combines this transform with another.
 
Vector3 Location () const
 Gets the location of the transform.
 
Vector3 Scale () const
 Gets the scale of the transform.
 
Quaternion Rotation () const
 Gets the rotation of the transform as a quaternion.
 
Vector3 EulerRotation () const
 Gets the rotation of the transform as Euler angles.
 
Matrix4Row GetMat4Transform ()
 Gets the 4x4 transformation matrix.
 
void ComputeWorldTransform ()
 Computes the world transformation matrix from location, rotation, and scale.
 

Detailed Description

Represents a 3D transformation including translation, rotation, and scale.

Provides methods for manipulating and querying the transform, as well as converting between local and world space.

Constructor & Destructor Documentation

◆ Transform()

Transform::Transform ( Vector3 pLocation,
Vector3 pScale,
Quaternion pRotation )
inline

Constructs a transform with specified location, scale, and rotation.

Parameters
pLocationThe position.
pScaleThe scale.
pRotationThe rotation as a quaternion.

Member Function Documentation

◆ AddRotation()

void Transform::AddRotation ( Vector3 newRotation)
inline

Adds a rotation to the current rotation using Euler angles.

Parameters
newRotationThe rotation to add as Euler angles.

◆ EulerRotation()

Vector3 Transform::EulerRotation ( ) const
inline

Gets the rotation of the transform as Euler angles.

Returns
The Euler angles.

◆ Forward()

Vector3 Transform::Forward ( ) const
inline

Gets the forward direction vector in world space.

Returns
The forward vector.

◆ GetMat4Transform()

Matrix4Row Transform::GetMat4Transform ( )
inline

Gets the 4x4 transformation matrix.

Returns
The transformation matrix.

◆ InverseTransformPosition()

Vector3 Transform::InverseTransformPosition ( const Vector3 & worldPosition) const
inline

Transforms a world position to local space.

Parameters
worldPositionThe world position.
Returns
The transformed local position.

◆ Location()

Vector3 Transform::Location ( ) const
inline

Gets the location of the transform.

Returns
The location.

◆ operator+()

Transform Transform::operator+ ( const Transform & q) const
inline

Combines this transform with another.

Parameters
qThe other transform.
Returns
The combined transform.

◆ Right()

Vector3 Transform::Right ( ) const
inline

Gets the right direction vector in world space.

Returns
The right vector.

◆ Rotation()

Quaternion Transform::Rotation ( ) const
inline

Gets the rotation of the transform as a quaternion.

Returns
The rotation.

◆ Scale()

Vector3 Transform::Scale ( ) const
inline

Gets the scale of the transform.

Returns
The scale.

◆ SetLocation() [1/2]

void Transform::SetLocation ( Vector2 newLocation)
inline

Sets the location of the transform using a Vector2.

Parameters
newLocationThe new location.

◆ SetLocation() [2/2]

void Transform::SetLocation ( Vector3 newLocation)
inline

Sets the location of the transform.

Parameters
newLocationThe new location.

◆ SetRotation() [1/3]

void Transform::SetRotation ( float newRotation)
inline

Sets the rotation of the transform using a float (implementation dependent).

Parameters
newRotationThe new rotation.

◆ SetRotation() [2/3]

void Transform::SetRotation ( Quaternion newRotation)
inline

Sets the rotation of the transform.

Parameters
newRotationThe new rotation as a quaternion.

◆ SetRotation() [3/3]

void Transform::SetRotation ( Vector3 newRotation)
inline

Sets the rotation of the transform using Euler angles.

Parameters
newRotationThe new rotation as Euler angles.

◆ SetScale() [1/2]

void Transform::SetScale ( Vector2 newScale)
inline

Sets the scale of the transform using a Vector2.

Parameters
newScaleThe new scale.

◆ SetScale() [2/2]

void Transform::SetScale ( Vector3 newScale)
inline

Sets the scale of the transform.

Parameters
newScaleThe new scale.

◆ TransformPosition()

Vector3 Transform::TransformPosition ( const Vector3 & localPosition) const
inline

Transforms a local position to world space.

Parameters
localPositionThe local position.
Returns
The transformed world position.

◆ Up()

Vector3 Transform::Up ( ) const
inline

Gets the up direction vector in world space.

Returns
The up vector.

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