49 float r0c0,
float r0c1,
float r0c2,
50 float r1c0,
float r1c1,
float r1c2,
51 float r2c0,
float r2c1,
float r2c2) {
89 float r0c0,
float r0c1,
float r0c2,
90 float r1c0,
float r1c1,
float r1c2,
91 float r2c0,
float r2c1,
float r2c2) {
177 array<float, 9> _data;
256 auto r = angle * 3.1415927f / 180.0f;
354 (b.
data[0] * t) + ((1.0f - t) * a.
data[0]),
355 (b.
data[1] * t) + ((1.0f - t) * a.
data[1]),
356 (b.
data[2] * t) + ((1.0f - t) * a.
data[2]),
357 (b.
data[3] * t) + ((1.0f - t) * a.
data[3]),
358 (b.
data[4] * t) + ((1.0f - t) * a.
data[4]),
359 (b.
data[5] * t) + ((1.0f - t) * a.
data[5]),
360 (b.
data[6] * t) + ((1.0f - t) * a.
data[6]),
361 (b.
data[7] * t) + ((1.0f - t) * a.
data[7]),
362 (b.
data[8] * t) + ((1.0f - t) * a.
data[8])
444 return this->
equals(matrix);
453 return this->
equals(matrix) ==
false;
static float sin(float x)
Returns the sine of x.
static float cos(float x)
Returns the cosine of x.
static constexpr float EPSILON
static auto abs(auto value)
Returns absolute value.
Matrix3x3 class representing matrix3x3 mathematical structure and operations for 2d space.
void getScale(Vector2 &scale) const
Get scale.
Matrix3x3 & identity()
Creates identity matrix.
const float & operator[](int i) const
Const array access operator.
float & operator[](int i)
Array access operator.
Matrix3x3 operator*(const float scalar) const
Operator * scalar.
Matrix3x3 & set(float r0c0, float r0c1, float r0c2, float r1c0, float r1c1, float r1c2, float r2c0, float r2c1, float r2c2)
Sets this matrix by its components.
Matrix3x3 & set(const array< float, 9 > &matrix)
Sets this matrix by array.
Matrix3x3 & set(const Matrix3x3 &matrix)
Sets this matrix by given matrix.
Matrix3x3 & setAxes(float angle)
Set coordinate system axis by rotation.
Matrix3x3 & setScale(const Vector2 &scale)
Set scale.
bool equals(const Matrix3x3 &matrix) const
Compares this matrix with given matrix.
bool operator!=(const Matrix3x3 &matrix) const
Non equality comparison operator.
Matrix3x3 & operator*=(const Matrix3x3 &matrix)
Operator *= matrix.
Matrix3x3(const Matrix3x3 &matrix)
Public constructor.
Matrix3x3(const array< float, 9 > &matrix)
Public constructor.
Vector2 multiply(const Vector2 &vector2) const
Multiplies this matrix with vector2.
bool operator==(const Matrix3x3 &matrix) const
Equality comparison operator.
const array< float, 9 > & getArray() const
Matrix3x3()
Public constructor.
Matrix3x3 & setTranslation(const Vector2 &vector2)
Sets translation in matrix.
static Matrix3x3 rotateAroundTextureCenter(float angle)
Creates rotation matrix that rotates around texture center by given angle.
Matrix3x3 clone() const
Clones this matrix.
Matrix3x3 & setAxes(const Vector2 &xAxis, const Vector2 &yAxis)
Set coordinate system axes.
Matrix3x3 & scale(const Vector2 &vector2)
Scales by vector2.
void getTranslation(Vector2 &vector2) const
Get translation.
void getAxes(Vector2 &xAxis, Vector2 &yAxis) const
Get coordinate system axes.
Matrix3x3 & scale(float scalar)
Scales by scalar.
static Matrix3x3 rotateAroundPoint(const Vector2 &point, float angle)
Creates rotation matrix that rotates around given point by given angle.
static Matrix3x3 interpolateLinear(const Matrix3x3 &a, const Matrix3x3 &b, float t)
Interpolates between matrix 1 and matrix 2 by 0f<=t<=1f linearly.
Matrix3x3(float r0c0, float r0c1, float r0c2, float r1c0, float r1c1, float r1c2, float r2c0, float r2c1, float r2c2)
Public constructor.
Matrix3x3 & multiply(const Matrix3x3 &matrix)
Multiplies this matrix with given matrix.
Vector2 class representing vector2 mathematical structure and operations with x, y components.
float computeLength() const
Vector2 & scale(const float scalar)
Scales by scalar.
Vector2 clone() const
Clones this vector2.
Vector2 & normalize()
Normalizes this vector2.
Vector2 & set(float x, float y)
Sets this vector2 by its components.