A simple transformation (rotation then translation)
More...
#include <gf/Transform.h>
A simple transformation (rotation then translation)
This class is meant for simple transformation as can be seen in physics. It is the composition of a rotation and a translation.
For more complex affine transformation, you can use gf::Matrix3f.
- See also
- gf::Matrix3f, gf::Rotation, gf::Translation
◆ Transform() [1/4]
gf::Transform::Transform |
( |
| ) |
|
|
inline |
Default constructor.
The default transform is the identity.
◆ Transform() [2/4]
gf::Transform::Transform |
( |
float |
angle, |
|
|
Vector2f |
offset |
|
) |
| |
|
inline |
Constructor with a rotation and a translation.
- Parameters
-
angle | The rotation angle |
offset | The translation offset |
◆ Transform() [3/4]
gf::Transform::Transform |
( |
float |
angle | ) |
|
|
inline |
Constructor with a rotation.
There is no translation.
- Parameters
-
◆ Transform() [4/4]
gf::Transform::Transform |
( |
Vector2f |
offset | ) |
|
|
inline |
Constructor with a translation.
There is no rotation.
- Parameters
-
offset | The translation offset |
◆ getAngle()
float gf::Transform::getAngle |
( |
| ) |
const |
|
inline |
Get the rotation angle.
- Returns
- The rotation angle
◆ getOffset()
Vector2f gf::Transform::getOffset |
( |
| ) |
const |
|
inlinenoexcept |
Get the translation offset.
- Returns
- The translation offset
◆ setAngle()
void gf::Transform::setAngle |
( |
float |
angle | ) |
|
|
inline |
Set the rotation angle.
- Parameters
-
◆ setOffset()
void gf::Transform::setOffset |
( |
Vector2f |
offset | ) |
|
|
inlinenoexcept |
Set the translation offset.
- Parameters
-
offset | The translation offset |
◆ inverseTransform()
Apply an inverse transformation to a 2D point.
- Parameters
-
trans | The transformation |
point | The point to transform |
- Returns
- The transformed point
◆ transform()
Apply a transformation to a 2D point.
- Parameters
-
trans | The transformation |
point | The point to transform |
- Returns
- The transformed point
◆ rotation
The rotation of the transformation.
◆ translation
The translation of the transformation.