Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <IceMatrix4x4.h>
Public Member Functions | |
inline_ | Matrix4x4 () |
Empty constructor. More... | |
inline_ | Matrix4x4 (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33) |
Constructor from 16 values. More... | |
inline_ | Matrix4x4 (const Matrix4x4 &mat) |
Copy constructor. More... | |
inline_ | ~Matrix4x4 () |
Destructor. More... | |
inline_ Matrix4x4 & | Set (float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22) |
Assign values (rotation only) More... | |
inline_ Matrix4x4 & | Set (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33) |
Assign values. More... | |
inline_ void | Copy (const Matrix4x4 &source) |
Copy from a Matrix4x4. More... | |
inline_ void | GetRow (const udword r, HPoint &p) const |
Returns a row. More... | |
inline_ void | GetRow (const udword r, Point &p) const |
Returns a row. More... | |
inline_ const HPoint & | GetRow (const udword r) const |
Returns a row. More... | |
inline_ HPoint & | GetRow (const udword r) |
Returns a row. More... | |
inline_ void | SetRow (const udword r, const HPoint &p) |
Sets a row. More... | |
inline_ void | SetRow (const udword r, const Point &p) |
Sets a row. More... | |
inline_ void | GetCol (const udword c, HPoint &p) const |
Returns a column. More... | |
inline_ void | GetCol (const udword c, Point &p) const |
Returns a column. More... | |
inline_ void | SetCol (const udword c, const HPoint &p) |
Sets a column. More... | |
inline_ void | SetCol (const udword c, const Point &p) |
Sets a column. More... | |
inline_ const HPoint & | GetTrans () const |
Returns the translation part of the matrix. More... | |
inline_ void | GetTrans (Point &p) const |
Gets the translation part of the matrix. More... | |
inline_ void | SetTrans (const Point &p) |
Sets the translation part of the matrix, from a Point. More... | |
inline_ void | SetTrans (const HPoint &p) |
Sets the translation part of the matrix, from a HPoint. More... | |
inline_ void | SetTrans (float tx, float ty, float tz) |
Sets the translation part of the matrix, from floats. More... | |
inline_ void | SetScale (const Point &p) |
Sets the scale from a Point. The point is put on the diagonal. More... | |
inline_ void | SetScale (float sx, float sy, float sz) |
Sets the scale from floats. Values are put on the diagonal. More... | |
void | Scale (const Point &p) |
Scales from a Point. Each row is multiplied by a component. More... | |
void | Scale (float sx, float sy, float sz) |
Scales from floats. Each row is multiplied by a value. More... | |
inline_ float | Trace () const |
Computes the trace. The trace is the sum of the 4 diagonal components. More... | |
inline_ float | Trace3x3 () const |
Computes the trace of the upper 3x3 matrix. More... | |
inline_ void | Zero () |
Clears the matrix. More... | |
inline_ void | Identity () |
Sets the identity matrix. More... | |
inline_ bool | IsIdentity () const |
Checks for identity. More... | |
inline_ BOOL | IsValid () const |
Checks matrix validity. More... | |
void | RotX (float angle) |
Sets a rotation matrix around the X axis. More... | |
void | RotY (float angle) |
Sets a rotation matrix around the Y axis. More... | |
void | RotZ (float angle) |
Sets a rotation matrix around the Z axis. More... | |
Matrix4x4 & | Rot (float angle, Point &p1, Point &p2) |
Makes a rotation matrix about an arbitrary axis. More... | |
void | Transpose () |
Transposes the matrix. More... | |
float | CoFactor (udword row, udword col) const |
Computes a cofactor. Used for matrix inversion. More... | |
float | Determinant () const |
Computes the determinant of the matrix. More... | |
Matrix4x4 & | Invert () |
Inverts the matrix. Determinant must be different from zero, else matrix can't be inverted. More... | |
inline_ | operator Matrix3x3 () const |
Casts a Matrix4x4 to a Matrix3x3. More... | |
operator Quat () const | |
Casts a Matrix4x4 to a Quat. More... | |
operator PR () const | |
Casts a Matrix4x4 to a PR. More... | |
inline_ Matrix4x4 | operator+ (const Matrix4x4 &mat) const |
Operator for Matrix4x4 Plus = Matrix4x4 + Matrix4x4;. More... | |
inline_ Matrix4x4 | operator- (const Matrix4x4 &mat) const |
Operator for Matrix4x4 Minus = Matrix4x4 - Matrix4x4;. More... | |
inline_ Matrix4x4 | operator* (const Matrix4x4 &mat) const |
Operator for Matrix4x4 Mul = Matrix4x4 * Matrix4x4;. More... | |
inline_ HPoint | operator* (const HPoint &v) const |
Operator for HPoint Mul = Matrix4x4 * HPoint;. More... | |
inline_ Point | operator* (const Point &v) const |
Operator for Point Mul = Matrix4x4 * Point;. More... | |
inline_ Matrix4x4 | operator* (float s) const |
Operator for Matrix4x4 Scale = Matrix4x4 * float;. More... | |
inline_ Matrix4x4 | operator/ (float s) const |
Operator for Matrix4x4 Div = Matrix4x4 / float;. More... | |
inline_ Matrix4x4 & | operator+= (const Matrix4x4 &mat) |
Operator for Matrix4x4 += Matrix4x4;. More... | |
inline_ Matrix4x4 & | operator-= (const Matrix4x4 &mat) |
Operator for Matrix4x4 -= Matrix4x4;. More... | |
Matrix4x4 & | operator*= (const Matrix4x4 &mat) |
Operator for Matrix4x4 *= Matrix4x4;. More... | |
inline_ Matrix4x4 & | operator*= (float s) |
Operator for Matrix4x4 *= float;. More... | |
inline_ Matrix4x4 & | operator/= (float s) |
Operator for Matrix4x4 /= float;. More... | |
inline_ const HPoint & | operator[] (int row) const |
inline_ HPoint & | operator[] (int row) |
Public Attributes | |
float | m [4][4] |
Friends | |
inline_ friend Matrix4x4 | operator* (float s, const Matrix4x4 &mat) |
Operator for Matrix4x4 Scale = float * Matrix4x4;. More... | |
inline_ friend Matrix4x4 | operator/ (float s, const Matrix4x4 &mat) |
Operator for Matrix4x4 Div = float / Matrix4x4;. More... | |
Related Functions | |
(Note that these are not member functions.) | |
InvertPRMatrix (Matrix4x4 &dest, const Matrix4x4 &src) | |
4x4 matrix. DirectX-compliant, ie row-column order, ie m[Row][Col]. Same as: m11 m12 m13 m14 first row. m21 m22 m23 m24 second row. m31 m32 m33 m34 third row. m41 m42 m43 m44 fourth row. Translation is (m41, m42, m43), (m14, m24, m34, m44) = (0, 0, 0, 1). Stored in memory as m11 m12 m13 m14 m21...
Multiplication rules:
[x'y'z'1] = [xyz1][M]
x' = x*m11 + y*m21 + z*m31 + m41 y' = x*m12 + y*m22 + z*m32 + m42 z' = x*m13 + y*m23 + z*m33 + m43 1' = 0 + 0 + 0 + m44
Definition at line 21 of file IceMatrix4x4.h.
|
inline |
|
inline |
Constructor from 16 values.
Definition at line 30 of file IceMatrix4x4.h.
|
inline |
Computes a cofactor. Used for matrix inversion.
Copy from a Matrix4x4.
Definition at line 69 of file IceMatrix4x4.h.
References CopyMemory(), and m.
float Matrix4x4::Determinant | ( | ) | const |
Computes the determinant of the matrix.
Returns a row.
Definition at line 77 of file IceMatrix4x4.h.
|
inline |
Matrix4x4& Matrix4x4::Invert | ( | ) |
Inverts the matrix. Determinant must be different from zero, else matrix can't be inverted.
Matrix4x4::operator PR | ( | ) | const |
Casts a Matrix4x4 to a PR.
Matrix4x4::operator Quat | ( | ) | const |
Casts a Matrix4x4 to a Quat.
Operator for Point Mul = Matrix4x4 * Point;.
Definition at line 306 of file IceMatrix4x4.h.
Operator for Matrix4x4 Scale = Matrix4x4 * float;.
Definition at line 314 of file IceMatrix4x4.h.
Operator for Matrix4x4 *= Matrix4x4;.
Definition at line 376 of file IceMatrix4x4.h.
References m, HPoint::w, Point::x, Point::y, and Point::z.
Operator for Matrix4x4 *= float;.
Definition at line 408 of file IceMatrix4x4.h.
Operator for Matrix4x4 Div = Matrix4x4 / float;.
Definition at line 334 of file IceMatrix4x4.h.
Operator for Matrix4x4 /= float;.
Definition at line 418 of file IceMatrix4x4.h.
Definition at line 428 of file IceMatrix4x4.h.
Definition at line 429 of file IceMatrix4x4.h.
Makes a rotation matrix about an arbitrary axis.
|
inline |
Sets a rotation matrix around the X axis.
Definition at line 214 of file IceMatrix4x4.h.
References Identity().
|
inline |
Sets a rotation matrix around the Y axis.
Definition at line 216 of file IceMatrix4x4.h.
References Identity().
|
inline |
Sets a rotation matrix around the Z axis.
Definition at line 218 of file IceMatrix4x4.h.
References Identity().
|
inline |
Scales from a Point. Each row is multiplied by a component.
Definition at line 111 of file IceMatrix4x4.h.
|
inline |
Assign values.
Definition at line 56 of file IceMatrix4x4.h.
Sets the scale from floats. Values are put on the diagonal.
Definition at line 109 of file IceMatrix4x4.h.
Sets the translation part of the matrix, from floats.
Definition at line 103 of file IceMatrix4x4.h.
Computes the trace of the upper 3x3 matrix.
Definition at line 170 of file IceMatrix4x4.h.
|
inline |
|
inline |
Inverts a PR matrix. (which only contains a rotation and a translation) This is faster and less subject to FPU errors than the generic inversion code.
dest | [out] destination matrix |
src | [in] source matrix |
Operator for Matrix4x4 Scale = float * Matrix4x4;.
Definition at line 324 of file IceMatrix4x4.h.
Operator for Matrix4x4 Div = float / Matrix4x4;.
Definition at line 346 of file IceMatrix4x4.h.
float Matrix4x4::m[4][4] |
Definition at line 433 of file IceMatrix4x4.h.
Referenced by Copy(), Matrix4x4(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), TransformPoint3x3(), and TransformPoint4x3().