![]() |
VMTK
|
#include <vmath.h>
Public Member Functions | |
Matrix4 () | |
Matrix4 (const T *dt) | |
Matrix4 (const T dt[4][4]) | |
Matrix4 (const Matrix4< T > &src) | |
Matrix4 (Vector4< T > v[]) | |
template<class FromT > | |
Matrix4 (const Matrix4< FromT > &src) | |
void | identity () |
Vector4< T > | vectorProductMatrix (const Vector4< T > &v) const |
vectorProductMatrix: Multiplication function More... | |
bool | operator== (const Matrix4< T > &rhs) const |
bool | operator!= (const Matrix4< T > &rhs) const |
T & | at (int x, int y) |
const T & | at (int x, int y) const |
T & | operator() (int i, int j) |
const T & | operator() (int i, int j) const |
void | setTranslation (const Vector3< T > &v) |
void | setTranslation (T nx, T ny, T nz) |
Sets translation part of matrix. More... | |
Vector3< T > | getTranslation () const |
void | setRotation (const Matrix3< T > &m) |
Vector3< T > | getScale () const |
void | setScale (T s) |
void | setScale (T sx, T sy, T sz) |
void | setScale (const Vector3< T > &s) |
Matrix4< T > & | operator= (const Matrix4< T > &rhs) |
template<class FromT > | |
Matrix4< T > & | operator= (const Matrix4< FromT > &rhs) |
Matrix4< T > & | operator= (const T *rhs) |
Matrix4< T > | operator+ (const Matrix4< T > &rhs) const |
Matrix4< T > | operator- (const Matrix4< T > &rhs) const |
Matrix4< T > | operator+ (T rhs) const |
Matrix4< T > | operator- (T rhs) const |
Matrix4< T > | operator* (T rhs) const |
Matrix4< T > | operator/ (T rhs) const |
Vector4< T > | operator* (const Vector4< T > &rhs) const |
Vector3< T > | operator* (const Vector3< T > &rhs) const |
Matrix4< T > | operator* (Matrix4< T > rhs) const |
T | det () |
Matrix4< T > | inverse () |
Matrix4< T > | transpose () |
Matrix4< T > | lerp (T fact, const Matrix4< T > &rhs) const |
operator T* () | |
operator const T * () const | |
std::string | toString () const |
Static Public Member Functions | |
static Matrix4< T > | createMat4FromMat3 (Matrix3< T > n) |
createMat4FromMat3 Creates 4x4 Matrix from 3x3 Matrix (Homogeneous Matrix). More... | |
static Vector4< T > | vectorProductMatrix (const Vector4< T > v, Matrix4< T > m) |
vectorProductMatrix: Multiplication function More... | |
static Matrix4< T > | createRotationAroundAxis (T xDeg, T yDeg, T zDeg) |
static Vector3< T > | getEulerAngles (Matrix4< T > R) |
static Matrix4< T > | createTranslation (T x, T y, T z, T w=1) |
Creates translation matrix. More... | |
static Matrix4< T > | createScale (T sx, T sy, T sz) |
static Matrix4< T > | createLookAt (const Vector3< T > &eyePos, const Vector3< T > ¢erPos, const Vector3< T > &upDir) |
static Matrix4< T > | createFrustum (T left, T right, T bottom, T top, T zNear, T zFar) |
static Matrix4< T > | createOrtho (T left, T right, T bottom, T top, T zNear, T zFar) |
static Matrix4< T > | Perspective_vmath (T fovy, T aspect, T n, T f) |
set up a perspective projection matrix More... | |
static Matrix4< T > | Perspective (T verticalAngle, T aspectRatio, T nearPlane, T farPlane) |
set up a perspective projection matrix More... | |
template<class FromT > | |
static Matrix4< T > | fromRowMajorArray (const FromT *arr) |
template<class FromT > | |
static Matrix4< T > | fromColumnMajorArray (const FromT *arr) |
Public Attributes | |
T | data [16] |
Data stored in column major order. | |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const Matrix4< T > &rhs) |
Class for matrix 4x4
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Creates OpenGL compatible perspective projection according specified frustum parameters.
left | Specify the coordinate for the left vertical clipping plane, |
right | Specify the coordinate for the right vertical clipping plane. |
bottom | Specify the coordinate for the bottom horizontal clipping plane, |
top | Specify the coordinate for the top horizontal clipping plane. |
zNear | Specify the distance to the near clipping plane. Distance must be positive. |
zFar | Specify the distance to the far depth clipping plane. Distance must be positive. |
Definition at line 2624 of file vmath.h.
|
inlinestatic |
Creates new view matrix to look from specified position eyePos to specified position centerPos
eyePos | A position of camera |
centerPos | A position where camera looks-at |
upDir | Direction of up vector |
Definition at line 2578 of file vmath.h.
|
inlinestatic |
|
inlinestatic |
Creates OpenGL compatible orthographic projection matrix.
left | Specify the coordinate for the left vertical clipping plane, |
right | Specify the coordinate for the right vertical clipping plane. |
bottom | Specify the coordinate for the bottom horizontal clipping plane, |
top | Specify the coordinate for the top horizontal clipping plane. |
zNear | Specify the distance to the nearer depth clipping plane. This value is negative if the plane is to be behind the viewer, |
zFar | Specify the distance to the farther depth clipping plane. This value is negative if the plane is to be behind the viewer. |
Definition at line 2682 of file vmath.h.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Creates translation matrix.
Creates translation matrix.
x | X-direction translation |
y | Y-direction translation |
z | Z-direction translation |
w | for W-coordinate translation (implicitly set to 1) |
Definition at line 2542 of file vmath.h.
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
Linear interpolation of two matrices
fact | Factor of interpolation. For translation from positon of this matrix (lhs) to matrix rhs, values of factor goes from 0.0 to 1.0. |
rhs | Second Matrix for interpolation |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Equality test operator
rhs | Right hand side argument of binary operator. |
|
inlinestatic |
set up a perspective projection matrix
[in] | verticalAngle | field of view angle, in degrees, in the y direction |
[in] | aspectRatio | ratio of x (width) and y (height) |
[in] | nearPlane | near clipping plane distance from the viewer |
[in] | farPlane | far clipping plane distance from the viewer |
Definition at line 2762 of file vmath.h.
|
inlinestatic |
set up a perspective projection matrix
[in] | fovy | field of view angle, in degrees, in the y direction |
[in] | aspect | ratio of x (width) to y (height) |
[in] | n | near clipping plane distance from the viewer |
[in] | f | far clipping plane distance fromn the viewer |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
friend |