#include <Matrix.h>
Public Member Functions | |
| Matrix () | |
| Matrix (const float f) | |
| Matrix (const float x, const float y, const float z) | |
| Matrix (const Vec3f &t) | |
| Matrix (const float angle, const Vec3f &axis) | |
| void | set (int x, int y, float value) |
| float | get (int x, int y) const |
| Matrix & | operator *= (const Matrix &m) |
| Vec3f | transformVector (const Vec3f &vector) const |
Private Attributes | |
| float | mValues [4][4] |
| all the values | |
Friends | |
| Matrix | operator * (const Matrix &m, const float f) |
| Matrix | operator * (const float f, const Matrix &m) |
| Vec3f | operator * (const Matrix &m, const Vec3f &v) |
| Vec3f | operator * (const Vec3f &v, const Matrix &m) |
| Ray | operator * (const Matrix &m, const Ray &r) |
| Ray | operator * (const Ray &r, const Matrix &m) |
| Matrix | operator * (const Matrix &m1, const Matrix &m2) |
| std::ostream & | operator<< (std::ostream &o, const Matrix &m) |
Definition at line 15 of file Matrix.h.
| Matrix::Matrix | ( | ) | [inline] |
| Matrix::Matrix | ( | const float | f | ) | [inline] |
| Matrix::Matrix | ( | const float | x, | |
| const float | y, | |||
| const float | z | |||
| ) | [inline] |
| Matrix::Matrix | ( | const Vec3f & | t | ) | [inline] |
Construct a translation matrix
1 0 0 t.x 0 1 0 t.y 0 0 1 t.z 0 0 0 1
| t | Translation vector |
Definition at line 104 of file Matrix.h.
References mValues, Vec3f::x(), Vec3f::y(), and Vec3f::z().
| Matrix::Matrix | ( | const float | angle, | |
| const Vec3f & | axis | |||
| ) | [inline] |
Construct a rotation matrix
x^2(1-c)+c xy(1-c)-zs xz(1-c)+ys 0 yx(1-c)+zs y^2(1-c)+c yz(1-c)-xs 0 xz(1-c)-ys yz(1-c)+xs z^2(1-c)+c 0 0 0 0 1
Where c = cos(angle), s = sin(angle) and (x,y,z).length() == 1
This rotation follows the right-hand rule, so if the vector axis points toward the user, the rotation will be counterclockwise.
| angle | Rotation angle in radian | |
| axis | Rotation axis vector, normalized if needed |
Definition at line 137 of file Matrix.h.
References mValues, and Vec3f::normal().
| void Matrix::set | ( | int | x, | |
| int | y, | |||
| float | value | |||
| ) | [inline] |
| float Matrix::get | ( | int | x, | |
| int | y | |||
| ) | const [inline] |
Multiply with given vector handling them as a _vector_ and NOT as point. Correctly transforms 3D -> 4D -> 3D
Definition at line 208 of file Matrix.h.
References mValues.
Referenced by CameraInstructionMove::execute(), operator *(), PhysicalObject::toGlobalCoordinates(), and PhysicalObject::toLocalCoordinates().
| std::ostream& operator<< | ( | std::ostream & | o, | |
| const Matrix & | m | |||
| ) | [friend] |
Output operator
Definition at line 10 of file Matrix.cpp.
float Matrix::mValues[4][4] [private] |
all the values
Definition at line 224 of file Matrix.h.
Referenced by get(), Matrix(), operator *(), operator<<(), set(), and transformVector().
1.5.1