AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::Transform Class Reference

2D transform composed of scale, rotation, and translation. More...

#include </d/a/AeonGUI/AeonGUI/include/aeongui/Transform.hpp>

Public Member Functions

 Transform ()
 Default constructor. Identity transform.
 Transform (const Vector2 &aScale, float aRotation, const Vector2 aTranslation)
 Construct from scale, rotation, and translation.
const Vector2 & GetScale () const
 Get the scale component.
float GetRotation () const
 Get the rotation angle.
const Vector2 & GetTranslation () const
 Get the translation component.
Matrix2x3 GetMatrix () const
 Build the equivalent 2x3 transformation matrix.
void SetScale (const Vector2 &aScale)
 Set the scale component.
void SetRotation (float aRotation)
 Set the rotation angle.
void SetTranslation (const Vector2 &)
 Set the translation component.

Operators

Transform & operator*= (const Transform &aTransform)
 Combine this transform with another (post-multiply).

Detailed Description

2D transform composed of scale, rotation, and translation.

Convenience class that decomposes a 2D affine transformation into its constituent components and can produce a Matrix2x3.

Constructor & Destructor Documentation

◆ Transform()

AeonGUI::Transform::Transform ( const Vector2 & aScale,
float aRotation,
const Vector2 aTranslation )

Construct from scale, rotation, and translation.

Parameters
aScaleScale factors per axis.
aRotationRotation angle in radians.
aTranslationTranslation vector.

Member Function Documentation

◆ GetMatrix()

Matrix2x3 AeonGUI::Transform::GetMatrix ( ) const

Build the equivalent 2x3 transformation matrix.

Returns
The composed Matrix2x3.

◆ GetRotation()

float AeonGUI::Transform::GetRotation ( ) const

Get the rotation angle.

Returns
Rotation in radians.

◆ GetScale()

const Vector2 & AeonGUI::Transform::GetScale ( ) const

Get the scale component.

Returns
Const reference to the scale vector.

◆ GetTranslation()

const Vector2 & AeonGUI::Transform::GetTranslation ( ) const

Get the translation component.

Returns
Const reference to the translation vector.

◆ operator*=()

Transform & AeonGUI::Transform::operator*= ( const Transform & aTransform)

Combine this transform with another (post-multiply).

Parameters
aTransformThe right-hand-side transform.
Returns
Reference to this transform.

◆ SetRotation()

void AeonGUI::Transform::SetRotation ( float aRotation)

Set the rotation angle.

Parameters
aRotationThe new rotation in radians.

◆ SetScale()

void AeonGUI::Transform::SetScale ( const Vector2 & aScale)

Set the scale component.

Parameters
aScaleThe new scale vector.

◆ SetTranslation()

void AeonGUI::Transform::SetTranslation ( const Vector2 & aTranslation)

Set the translation component.

Parameters
aTranslationThe new translation vector.

The documentation for this class was generated from the following files:
  • /d/a/AeonGUI/AeonGUI/include/aeongui/Transform.hpp
  • /d/a/AeonGUI/AeonGUI/core/Transform.cpp