![]() |
Rune Engine
Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
|
2 x 2 matrix to be used for math. More...
#include <mat2.h>
Public Member Functions | |
| Mat2 () | |
| Default empty constructor that sets X and Y to 0. | |
| Mat2 (double a11, double a12, double a21, double a22) | |
| Constructor that sets up a new vector. More... | |
| Mat2 | operator- (const Mat2 &right) |
| Overload of subtraction operator. More... | |
| Mat2 | operator- () |
| Overload of negation operator. More... | |
| Mat2 | operator+ (const Mat2 &right) |
| Overload of addition operator. More... | |
| Mat2 | operator* (const Mat2 &right) |
| Overload of multiplication operator. More... | |
| Mat2 | operator* (double scalar) |
| Overload of multiplication operator for a scalar on the left. More... | |
| Vec2 | operator* (const Vec2 &right) |
| Overload of multiplication operator for a rune::Mat2. More... | |
| Mat2 | operator/ (const Mat2 &right) |
| Overload of division operator. More... | |
| Mat2 & | operator-= (const Mat2 &right) |
| Overload of -= operator. More... | |
| Mat2 & | operator+= (const Mat2 &right) |
| Overload of += operator. More... | |
| Mat2 & | operator+= (const double scalar) |
| Overload of += operator for scalar. More... | |
| Mat2 & | operator*= (const Mat2 &right) |
| Overload of *= operator. More... | |
| Mat2 & | operator*= (const double right) |
| Overload of *= operator for a scalar multiplier. More... | |
| bool | operator== (const Mat2 &right) |
| Overload of comparator operator. More... | |
| bool | operator!= (const Mat2 &right) |
| Overload of != operator. More... | |
| rune::Mat2 | operator/ (double scalar) |
| Overload of division operator for a scalar. More... | |
| Mat2 | invert () |
| Inversion of the matrix. More... | |
| double | determinant () |
| Determinant of the matrix. More... | |
| double * | operator[] (int index) |
| Array like accessing of elements. | |
| std::ostream & | operator<< (std::ostream &os, const rune::Mat2 &matrix) |
| rune::Vec2 | operator* (Vec2 const &vec, Mat2 &mat) |
| rune::Mat2 | operator* (double scalar, Mat2 &mat) |
Friends | |
| RUNE_ENGINE std::ostream & | operator<< (std::ostream &os, const Mat2 &vector) |
| Overload of stream operator for printing. | |
2 x 2 matrix to be used for math.
You should access this matrix using row major order. That means accessing the matrix using Mat2[y][x] where y is the row and x is the column number.
| rune::Mat2::Mat2 | ( | double | a11, |
| double | a12, | ||
| double | a21, | ||
| double | a22 | ||
| ) |
Constructor that sets up a new vector.
| a11 | Element a11 of the matrix. |
| a12 | Element a12 of the matrix. |
| a21 | Element a21 of the matrix. |
| a22 | Element a22 of the matrix. |
| double rune::Mat2::determinant | ( | ) |
Determinant of the matrix.
| rune::Mat2 rune::Mat2::invert | ( | ) |
Inversion of the matrix.
| right | The matrix to invert. |
| bool rune::Mat2::operator!= | ( | const Mat2 & | right | ) |
Overload of != operator.
| right | THe matrix to compare with. |
| rune::Mat2 rune::Mat2::operator* | ( | const Mat2 & | right | ) |
Overload of multiplication operator.
| right | The matrix to multiply by. |
| rune::Vec2 rune::Mat2::operator* | ( | const Vec2 & | right | ) |
Overload of multiplication operator for a rune::Mat2.
| right | The rune::Vec2 to be multiplied by. |
| rune::Mat2 rune::Mat2::operator* | ( | double | scalar | ) |
Overload of multiplication operator for a scalar on the left.
| scalar | The scalar to multiply by. |
| rune::Mat2 operator* | ( | double | scalar, |
| Mat2 & | mat | ||
| ) |
| scalar | |
| mat |
| rune::Vec2 operator* | ( | Vec2 const & | vec, |
| Mat2 & | mat | ||
| ) |
| vec | |
| mat |
| rune::Mat2 & rune::Mat2::operator*= | ( | const double | right | ) |
Overload of *= operator for a scalar multiplier.
| right | The scalar to multiply by. |
| rune::Mat2 & rune::Mat2::operator*= | ( | const Mat2 & | right | ) |
Overload of *= operator.
| right | The matrix to be multiplied by. |
| rune::Mat2 rune::Mat2::operator+ | ( | const Mat2 & | right | ) |
Overload of addition operator.
| right | The matrix to be added. |
| rune::Mat2 & rune::Mat2::operator+= | ( | const double | scalar | ) |
Overload of += operator for scalar.
| scalar | The scalar to be added. |
| rune::Mat2 & rune::Mat2::operator+= | ( | const Mat2 & | right | ) |
Overload of += operator.
| right | The matrix to be added. |
| rune::Mat2 rune::Mat2::operator- | ( | ) |
Overload of negation operator.
| rune::Mat2 rune::Mat2::operator- | ( | const Mat2 & | right | ) |
Overload of subtraction operator.
| right | The matrix to be subtracted. |
| rune::Mat2 & rune::Mat2::operator-= | ( | const Mat2 & | right | ) |
Overload of -= operator.
| right | The matrix to be subtracted. |
| rune::Mat2 rune::Mat2::operator/ | ( | const Mat2 & | right | ) |
Overload of division operator.
| right | The matrix to divide by |
| rune::Mat2 rune::Mat2::operator/ | ( | double | scalar | ) |
Overload of division operator for a scalar.
| scalar | The scalar to multiply by. |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const rune::Mat2 & | matrix | ||
| ) |
| os | Output stream that the vector should be printed to. |
| matrix | Vector to be printed. |
| bool rune::Mat2::operator== | ( | const Mat2 & | right | ) |
Overload of comparator operator.
| right | The matrix to compare with. |