![]() |
Kale
|
#include <Transform.hpp>
Public Member Functions | |
Transform () | |
Transform (const Matrix3f &matrix) | |
Transform (Matrix3f &&matrix) | |
Transform (const std::array< float, 9 > &arr) | |
Transform (std::array< float, 9 > &&arr) | |
Transform (const Vector2f &translation, float rotation, const Vector2f &scaleFactor, AngleUnit unit) | |
Transform (float translateX, float translateY, float rotation, float scaleX, float scaleY, AngleUnit unit) | |
void | setIdentity () |
void | scale (const Vector2f &vec) |
void | scale (float x, float y) |
void | scale (float factor) |
void | scale (float factor, const Vector2f &origin) |
void | scale (float x, float y, const Vector2f &origin) |
void | translate (const Vector2f &vec) |
void | translate (float x, float y) |
void | rotate (float angle, AngleUnit unit) |
void | rotate (float angle, AngleUnit unit, const Vector2f &origin) |
void | setTranslation (float x, float y) |
void | setTranslation (const Vector2f &vec) |
Vector2f | getTranslation () const |
void | setRotation (float angle, AngleUnit unit) |
float | getRotation (AngleUnit unit) const |
void | setScale (float scaleX, float scaleY) |
void | setScale (float scale) |
Vector2f | getScale () const |
Vector2f | transform (const Vector2f &vec) const |
void | transformInplace (Vector2f &vec) const |
Vector2f | inverseTransform (const Vector2f &vec) const |
void | inverseTransformInplace (Vector2f &vec) const |
RotatedRect | transform (const RotatedRect &rect) const |
RotatedRect | inverseTransform (const RotatedRect &rect) const |
RotatedRect | transform (const Rect &rect) const |
RotatedRect | inverseTransform (const Rect &rect) const |
Ray | transform (const Ray &ray) const |
Ray | inverseTransform (const Ray &ray) const |
Line | transform (const Line &line) const |
Line | inverseTransform (const Line &line) const |
Circle | transform (const Circle &circle) const |
Circle | inverseTransform (const Circle &circle) const |
template<typename T > | |
std::enable_if< std::is_base_of< Geometry, T >::value, bool >::type | isInView (const T &geometry, const Rect &sceneBounds) |
![]() | |
Matrix () | |
Matrix (const std::array< T, w *h > &arr) | |
Matrix (std::array< T, w *h > &&arr) | |
size_t | width () const |
size_t | height () const |
T & | operator[] (size_t i) |
const T & | operator[] (size_t i) const |
T & | operator() (size_t col, size_t row) |
const T & | operator() (size_t col, size_t row) const |
T & | get (size_t i) |
const T & | get (size_t i) const |
T & | get (size_t col, size_t row) |
const T & | get (size_t col, size_t row) const |
Matrix< w, h, T > | operator+ (const Matrix< w, h, T > &other) const |
Matrix< w, h, T > | operator+ (Matrix< w, h, T > &&other) const |
void | operator+= (const Matrix< w, h, T > &other) |
Matrix< w, h, T > | operator- (const Matrix< w, h, T > &other) const |
Matrix< w, h, T > | operator- (Matrix< w, h, T > &&other) const |
void | operator-= (const Matrix< w, h, T > &other) |
Matrix< w, h, T > | operator* (T scalar) const |
void | operator*= (T scalar) |
template<size_t w2> | |
Matrix< w2, h, T > | operator* (const Matrix< w2, w, T > &other) const |
Matrix< h, w, T > | transpose () const |
void | swapRows (size_t row1, size_t row2) |
void | scaleRow (size_t row, T scalar) |
void | addScaledRow (size_t row1, size_t row2, T scalar) |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==2 &&H==2, Vector2< T > >::type | operator* (const Vector2< T > &vec) const |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==2 &&H==2, Vector2< T > >::type | operator* (Vector2< T > &&vec) const |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==3 &&H==3, Vector3< T > >::type | operator* (const Vector3< T > &vec) const |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==3 &&H==3, Vector3< T > >::type | operator* (Vector3< T > &&vec) const |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==4 &&H==4, Vector4< T > >::type | operator* (const Vector4< T > &vec) const |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==4 &&H==4, Vector4< T > >::type | operator* (Vector4< T > &&vec) const |
template<typename R , size_t W = w, size_t H = h> | |
std::enable_if< W==2 &&H==2, R >::type | det () const |
template<typename R , size_t W = w, size_t H = h> | |
std::enable_if< W==3 &&H==3, R >::type | det () const |
template<typename R , size_t W = w, size_t H = h> | |
std::enable_if< W==H &&(W >3)&&std::is_signed< R >::value, R >::type | det () const |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==2 &&H==2, Matrix< W, H, T > >::type | inverse () |
template<size_t W = w, size_t H = h> | |
std::enable_if< W==3 &&H==3, Matrix< W, H, T > >::type | inverse () |
Additional Inherited Members | |
![]() | |
std::array< T, w *h > | data |
Represents a single transformation matrix.
Definition at line 42 of file Transform.hpp.
Transform::Transform | ( | ) |
Creates a transformation matrix with the identity matrix
Definition at line 28 of file Transform.cpp.
Transform::Transform | ( | const Matrix3f & | matrix | ) |
Creates a transformation matrix from a matrix
matrix | The matrix |
Definition at line 40 of file Transform.cpp.
Transform::Transform | ( | Matrix3f && | matrix | ) |
Creates a transformation matrix from a matrix
matrix | The matrix |
Definition at line 48 of file Transform.cpp.
Transform::Transform | ( | const std::array< float, 9 > & | arr | ) |
Creates a transformation matrix given an array
arr | The array |
Definition at line 56 of file Transform.cpp.
Transform::Transform | ( | std::array< float, 9 > && | arr | ) |
Creates a transformation matrix given an array
arr | The array |
Definition at line 64 of file Transform.cpp.
Transform::Transform | ( | const Vector2f & | translation, |
float | rotation, | ||
const Vector2f & | scaleFactor, | ||
AngleUnit | unit ) |
Creates a transformation matrix given the translation, rotation, and scale
translation | The translation of the matrix |
rotation | The rotation of the matrix |
scaleFactor | The scale factor of the matrix |
unit | The unit of the rotation |
Definition at line 75 of file Transform.cpp.
Transform::Transform | ( | float | translateX, |
float | translateY, | ||
float | rotation, | ||
float | scaleX, | ||
float | scaleY, | ||
AngleUnit | unit ) |
Creates a transformation matrix given the translation, rotation, and scale
translateX | The x translation of the matrix |
translateY | The y translation of the matrix |
rotation | The rotation of the matrix |
scaleX | The x scale factor of the matrix |
scaleY | The x scale factor of the matrix |
unit | The unit of the rotation |
Definition at line 92 of file Transform.cpp.
float Transform::getRotation | ( | AngleUnit | unit | ) | const |
Gets the rotation
unit | The unit to return the rotation in |
Definition at line 271 of file Transform.cpp.
Vector2f Transform::getScale | ( | ) | const |
Gets the scale of the matrix
Definition at line 302 of file Transform.cpp.
Vector2f Transform::getTranslation | ( | ) | const |
Inverse transforms a circle using this transformation matrix (Returns a circle transformed by this matrix to its original)
circle | The circle to transform |
Definition at line 480 of file Transform.cpp.
Inverse transforms a line using this transformation matrix (Returns a line transformed by this matrix to its original)
line | The line to transform |
Definition at line 458 of file Transform.cpp.
Inverse transforms a ray using this transformation matrix (Returns a ray transformed by this matrix to its original)
ray | The ray to transform |
Definition at line 435 of file Transform.cpp.
RotatedRect Transform::inverseTransform | ( | const Rect & | rect | ) | const |
Inverse transforms a rect using this transformation matrix (Returns a rect transformed by this matrix to its original)
rect | The rect to transform |
Inverse transforms a rect using this transformation matrix (Returns a rect transformed by this matrix to its original)
rect | The rect to transform |
Definition at line 407 of file Transform.cpp.
RotatedRect Transform::inverseTransform | ( | const RotatedRect & | rect | ) | const |
Inverse transforms a rect using this transformation matrix (Returns a rect transformed by this matrix to its original)
rect | The rect to transform |
Inverse transforms a rect using this transformation matrix (Returns a rect transformed by this matrix to its original)
rect | The rect to transform |
Definition at line 378 of file Transform.cpp.
Inverse transforms a vector using this transformation matrix (Returns a vector transformed by this matrix to its original)
vec | The vector to transform |
Definition at line 333 of file Transform.cpp.
void Transform::inverseTransformInplace | ( | Vector2f & | vec | ) | const |
Transforms a vector using this transformation matrix (Returns a vector transformed by this matrix to its original)
vec | The vector to transform |
Definition at line 352 of file Transform.cpp.
|
inline |
Checks whether or not a geometry is within the view of this camera/transform
geometry | The geometry to check for |
sceneBounds | The bounds of the scene |
Definition at line 323 of file Transform.hpp.
void Transform::rotate | ( | float | angle, |
AngleUnit | unit ) |
Rotates the transformation matrix
angle | The angle to rotate by |
unit | The unit of the angle |
Definition at line 201 of file Transform.cpp.
Rotates the transformation matrix about an origin
angle | The angle to rotate by |
unit | The unit of the angle |
origin | The origin to rotate about |
Definition at line 217 of file Transform.cpp.
void Transform::scale | ( | const Vector2f & | vec | ) |
Scales the transformation matrix
vec | The vector to scale by |
Definition at line 115 of file Transform.cpp.
void Transform::scale | ( | float | factor | ) |
Scales the transformation matrix
factor | The scale factor |
Definition at line 140 of file Transform.cpp.
void Transform::scale | ( | float | factor, |
const Vector2f & | origin ) |
Scales the transformation matrix about an origin
factor | The scale factor |
origin | The origin to scale from |
Definition at line 153 of file Transform.cpp.
void Transform::scale | ( | float | x, |
float | y ) |
Scales the transformation matrix
x | The x scale factor |
y | The y scale factor |
Definition at line 128 of file Transform.cpp.
void Transform::scale | ( | float | x, |
float | y, | ||
const Vector2f & | origin ) |
Scales the transformation matrix about an origin
x | The x scale factor |
y | The y scale factor |
origin | The origin to scale from |
Definition at line 165 of file Transform.cpp.
void Transform::setIdentity | ( | ) |
Sets this matrix to the identity matrix
Definition at line 103 of file Transform.cpp.
void Transform::setRotation | ( | float | angle, |
AngleUnit | unit ) |
Sets the rotation of the matrix
angle | The angle of the rotation |
unit | The unit of the angle |
Definition at line 255 of file Transform.cpp.
void Transform::setScale | ( | float | scale | ) |
Sets the scale of the matrix
scale | The scale factor (applies for both horizontal/vertical scaling) |
Definition at line 292 of file Transform.cpp.
void Transform::setScale | ( | float | scaleX, |
float | scaleY ) |
Sets the scale of the matrix
scaleX | The x component |
scaleY | The y component |
Definition at line 282 of file Transform.cpp.
void Transform::setTranslation | ( | const Vector2f & | vec | ) |
Sets the translation of the matrix
vec | The translation |
Definition at line 237 of file Transform.cpp.
void Transform::setTranslation | ( | float | x, |
float | y ) |
Sets the translation of the matrix
x | The x component |
y | The y component |
Definition at line 228 of file Transform.cpp.
Transforms a circle using this transformation matrix
circle | The circle to transform |
Definition at line 467 of file Transform.cpp.
Transforms a line using this transformation matrix
line | The line to transform |
Definition at line 448 of file Transform.cpp.
Transforms a ray using this transformation matrix
ray | The ray to transform |
Definition at line 421 of file Transform.cpp.
RotatedRect Transform::transform | ( | const Rect & | rect | ) | const |
Transforms a rect using this transformation matrix
rect | The rect to transform |
Transforms a rect using this transformation matrix
rect | The rect to transform |
Definition at line 392 of file Transform.cpp.
RotatedRect Transform::transform | ( | const RotatedRect & | rect | ) | const |
Transforms a rect using this transformation matrix
rect | The rect to transform |
Transforms a rect using this transformation matrix
rect | The rect to transform |
Definition at line 363 of file Transform.cpp.
Transforms a vector using this transformation matrix
vec | The vector to transform |
Definition at line 314 of file Transform.cpp.
void Transform::transformInplace | ( | Vector2f & | vec | ) | const |
Transforms a vector using this transformation matrix
vec | The vector to transform |
Definition at line 322 of file Transform.cpp.
void Transform::translate | ( | const Vector2f & | vec | ) |
Translates the transformation matrix
vec | The vector to translate by |
Definition at line 175 of file Transform.cpp.
void Transform::translate | ( | float | x, |
float | y ) |
Translates the transformation matrix
x | The x displacement |
y | The y displacement |
Definition at line 188 of file Transform.cpp.