21 #ifndef GF_TRANSFORM_H
22 #define GF_TRANSFORM_H
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
99 float cos = std::cos(angle);
100 float sin = std::sin(angle);
118 float cos = std::cos(angle);
119 float sin = std::sin(angle);
121 cos
, -sin
, center.x * (1 - cos) + center.x * sin
,
122 sin
, cos
, center.y * (1 - cos) - center.y * sin
,
156 factor.x
, 0.0f
, 0.0f
,
157 0.0f
, factor.y
, 0.0f
,
173 factor.x
, 0.0f
, center.x * (1.0f - factor.x)
,
174 0.0f
, factor.y
, center.y * (1.0f - factor.y)
,
198 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Vector2f transform(const Matrix3f &mat, Vector2f point)
Apply an affine transformation to a 2D point.
Definition: Transform.h:47
void scale(Matrix3f &mat, Vector2f factor)
Combine the current transform with a scaling.
Vector< float, 2 > Vector2f
A float vector with 2 components.
Definition: Vector.h:741
Matrix3f rotation(float angle, Vector2f center)
Get a rotation matrix.
Definition: Transform.h:117
Matrix3f scaling(Vector2f factor)
Get a scaling matrix.
Definition: Transform.h:154
Matrix< float, 3, 3 > Matrix3f
A float square matrix of size 3.
Definition: Matrix.h:326
Vector< T, S1 > operator*(const Matrix< T, S1, S2 > &lhs, const Vector< T, S2 > &rhs)
Matrix-vector multiplication.
Definition: Matrix.h:566
Matrix3f scaling(Vector2f factor, Vector2f center)
Get a scaling matrix.
Definition: Transform.h:171
void scale(Matrix3f &mat, Vector2f factor, Vector2f center)
Combine the current transform with a scaling.
Rect< float > RectF
A float rectangle.
Definition: Rect.h:306
Matrix3f rotation(float angle)
Get a rotation matrix.
Definition: Transform.h:98
void rotate(Matrix3f &mat, float angle)
Combine the current transform with a rotation.
Matrix3f translation(Vector2f offset)
Get a translation matrix.
Definition: Transform.h:73
void translate(Matrix3f &mat, Vector2f offset)
Combine the current transform with a translation.
RectF transform(const Matrix3f &mat, const RectF &rect)
Apply an affine transformaton to a rectangle.
constexpr Matrix(T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz)
Constructor that takes all the elements.
Definition: Matrix.h:219
constexpr Vector(Vector< T, 2 > xy, T z)
Constructor that takes a 2D vector and a z component.
Definition: Vector.h:482
void rotate(Matrix3f &mat, float angle, Vector2f center)
Combine the current transform with a rotation.
#define GF_API
Definition: Portability.h:35
Vector< float, 3 > Vector3f
A float vector with 3 components.
Definition: Vector.h:747