Matrix 4x4. More...
Public Member Functions | |
| matrix4 () | |
| empty constructor (identity) | |
| matrix4 (const double &x00, const double &x01, const double &x02, const double &x03, const double &x10, const double &x11, const double &x12, const double &x13, const double &x20, const double &x21, const double &x22, const double &x23, const double &x30, const double &x31, const double &x32, const double &x33) | |
| direct constructor with every value | |
| matrix4 (const matrix3 &m) | |
| direct constructor from matrix 3 | |
| const double & | operator() (const size_t &k1, const size_t &k2) const |
| Access to the k_th entry (k in [0,3]) | |
| double & | operator() (const size_t &k1, const size_t &k2) |
| Access to the k_th entry (k in [0,3]) | |
| const double * | pointer () const |
| fast pointer access | |
| double * | pointer_unprotected () |
| fast pointer access | |
| matrix4 | operator+ (const matrix4 &m2) const |
| |
| matrix4 | operator+ (const double &s) const |
| |
| matrix4 | operator- (const matrix4 &m2) const |
| |
| matrix4 | operator- (const double &s) const |
| |
| matrix4 | operator* (const double &s) const |
| multiply by a scalar operator | |
| v4 | operator* (const v4 &v) const |
| multiply matrix with a v4 | |
| v3 | operator* (const v3 &v) const |
| multiply matrix with a v3 (assume (v3.x,v3.y,v3.z,1) and normalize) | |
| matrix4 | operator* (const matrix4 &m2) const |
| matrix mulitplication | |
| matrix4 | operator/ (const double &s) const |
| divide by a scalar operator | |
| matrix4 & | operator+= (const matrix4 &m) |
| internal + | |
| matrix4 & | operator+= (const double &s) |
| internal + | |
| matrix4 & | operator-= (const matrix4 &m) |
| internal - | |
| matrix4 & | operator-= (const double &s) |
| internal - | |
| matrix4 & | operator*= (const double &s) |
| internal * | |
| matrix4 & | operator/= (const double &s) |
| internal / | |
| matrix4 | operator- () const |
| unary negation | |
| matrix4 | product_compontentwise (const matrix4 &m) const |
| does componentwise multiplication | |
| matrix4 & | product_compontentwise_internal (const matrix4 &m) |
| does componentwise multiplication | |
| matrix4 | transposed () const |
| transpose matrix | |
| matrix4 | translated (const v3 &translation) const |
| Translated matrix (return of copy of the translated matrix) | |
| void | translate_internal (const v3 &translation) |
| Translated matrix (modify the matrix) | |
| std::vector< double > | to_vector () const |
| convert 4x4 matrix into a 16 vector of double (glMultmatrixf) | |
Static Public Member Functions | |
| static matrix4 | identity () |
| build identity matrix | |
| static matrix4 | zeros () |
| build zero matrix | |
| static matrix4 | rotation (const v3 &axis, const double &angle) |
| build rotation matrix | |
| static matrix4 | scale (const double &s) |
| build scaling matrix | |
| static matrix4 | scale (const double &s_x, const double &s_y, const double &s_z, const double &s_w) |
| build scaling matrix | |
| static matrix4 | translation (const v3 &translation) |
| build translation matrix | |
| static matrix4 | transformation (const matrix3 &m3, const v3 &translation) |
| build from matrix3 and translation | |
| static matrix4 | projection_perspective (const double &fovy, const double &aspect, const double &z_near, const double &z_far) |
| build a perspective projection similar to gluPerspective | |
| static matrix4 | projection_frustum (const double &left, const double &right, const double &bottom, const double &top, const double &near, const double &far) |
| build a perspective projection (frustum) similar to gluPerspective see: http://www.opengl.org/sdk/docs/man/xhtml/glFrustum.xml | |
| static matrix4 | projection_orthographic (const double &left, const double &right, const double &bottom, const double &top, const double &near, const double &far) |
| build an orthographic projection similar to gluPerspective see: http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml | |
| static matrix4 | projection_look_at (const matrix4 ¤t_matrix, const v3 &eye, const v3 ¢er, const v3 &up) |
| build a perspective projection similar to gluLookAt see: http://www.opengl.org/sdk/docs/man/xhtml/gluLookAt.xml | |
Private Member Functions | |
| void | assert_size (const size_t &k1, const size_t &k2) const |
| assert that a size_t belongs to [[0,3]] | |
Private Attributes | |
| double | m [16] |
| internal storage of the matrix | |
Matrix 4x4.
| cpe::matrix4::matrix4 | ( | ) |
empty constructor (identity)
References m.
Referenced by identity(), operator+(), operator-(), operator/(), product_compontentwise(), projection_frustum(), projection_orthographic(), projection_perspective(), rotation(), scale(), transformation(), translation(), transposed(), and zeros().
| cpe::matrix4::matrix4 | ( | const double & | x00, |
| const double & | x01, | ||
| const double & | x02, | ||
| const double & | x03, | ||
| const double & | x10, | ||
| const double & | x11, | ||
| const double & | x12, | ||
| const double & | x13, | ||
| const double & | x20, | ||
| const double & | x21, | ||
| const double & | x22, | ||
| const double & | x23, | ||
| const double & | x30, | ||
| const double & | x31, | ||
| const double & | x32, | ||
| const double & | x33 | ||
| ) |
direct constructor with every value
References m.
|
private |
assert that a size_t belongs to [[0,3]]
Referenced by operator()().
Here is the caller graph for this function:
|
static |
| const double & cpe::matrix4::operator() | ( | const size_t & | k1, |
| const size_t & | k2 | ||
| ) | const |
Access to the k_th entry (k in [0,3])
References assert_size(), and m.
Here is the call graph for this function:| double & cpe::matrix4::operator() | ( | const size_t & | k1, |
| const size_t & | k2 | ||
| ) |
Access to the k_th entry (k in [0,3])
References assert_size(), and m.
Here is the call graph for this function:| matrix4 cpe::matrix4::operator* | ( | const double & | s | ) | const |
multiply by a scalar operator
References m.
multiply matrix with a v4
References m, cpe::v4::w(), cpe::v4::x(), cpe::v4::y(), and cpe::v4::z().
Here is the call graph for this function:multiply matrix with a v3 (assume (v3.x,v3.y,v3.z,1) and normalize)
References m, cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().
Here is the call graph for this function:matrix mulitplication
References m, pointer_unprotected(), and zeros().
Here is the call graph for this function:| matrix4 cpe::matrix4::operator+ | ( | const double & | s | ) | const |
| matrix4 cpe::matrix4::operator- | ( | const double & | s | ) | const |
| matrix4 cpe::matrix4::operator- | ( | ) | const |
| matrix4 cpe::matrix4::operator/ | ( | const double & | s | ) | const |
| const double * cpe::matrix4::pointer | ( | ) | const |
fast pointer access
References m.
Referenced by cpe::operator*(), operator+(), cpe::operator+(), cpe::operator-(), and cpe::operator<<().
Here is the caller graph for this function:| double * cpe::matrix4::pointer_unprotected | ( | ) |
fast pointer access
References m.
Referenced by operator*().
Here is the caller graph for this function:does componentwise multiplication
References m.
|
static |
build a perspective projection (frustum) similar to gluPerspective see: http://www.opengl.org/sdk/docs/man/xhtml/glFrustum.xml
References matrix4().
Here is the call graph for this function:
|
static |
build a perspective projection similar to gluLookAt see: http://www.opengl.org/sdk/docs/man/xhtml/gluLookAt.xml
References cpe::v3::cross(), translation(), cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
build an orthographic projection similar to gluPerspective see: http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml
References matrix4().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
build a perspective projection similar to gluPerspective
| double | fovy: in radian see: http://www.opengl.org/sdk/docs/man/xhtml/gluPerspective.xml |
References matrix4().
Here is the call graph for this function:build rotation matrix
References matrix4(), and cpe::v3::normalized().
Here is the call graph for this function:
|
static |
|
static |
| std::vector< double > cpe::matrix4::to_vector | ( | ) | const |
convert 4x4 matrix into a 16 vector of double (glMultmatrixf)
References m.
build from matrix3 and translation
References matrix4(), cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void cpe::matrix4::translate_internal | ( | const v3 & | translation | ) |
Translated matrix (modify the matrix)
References m, cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().
Referenced by translated().
Here is the call graph for this function:
Here is the caller graph for this function:Translated matrix (return of copy of the translated matrix)
References translate_internal().
Here is the call graph for this function:build translation matrix
References matrix4(), cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().
Referenced by projection_look_at().
Here is the call graph for this function:
Here is the caller graph for this function:| matrix4 cpe::matrix4::transposed | ( | ) | const |
|
static |
build zero matrix
References matrix4().
Referenced by operator*().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
internal storage of the matrix
Referenced by matrix4(), operator()(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), pointer(), pointer_unprotected(), product_compontentwise(), product_compontentwise_internal(), to_vector(), translate_internal(), and transposed().