zenilib: Zeni::Matrix4f Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
Zeni::Matrix4f Class Reference
Zenilib

A Featureful 4-Space Matrix Class. More...

`#include <Matrix4f.h>`

## Classes

class | Matrix4f_Row

## Public Member Functions

| Matrix4f ()
| Matrix4f (const float &aw, const float &ax, const float &ay, const float &az, const float &bw, const float &bx, const float &by, const float &bz, const float &cw, const float &cx, const float &cy, const float &cz, const float &dw, const float &dx, const float &dy, const float &dz)
| Matrix4f (const Vector3f &first, const Vector3f &second, const Vector3f &third, const bool &rows=false)
| Matrix4f (const Matrix4f &rhs)
float | determinant () const
| Get the determinant. More...
Vector3f | get_column (const int &column) const
| Get a column of the upper-left 3x3 matrix. More...
Vector3f | get_row (const int &row) const
| Get a row of the upper left 3x3 matrix. More...
Matrix4f & | invert ()
| Invert the matrix. More...
Matrix4f | inverted () const
| Get the inverse. More...
Matrix4f | operator* (const Matrix4f &rhs) const
| Get the product. More...
Matrix4f | operator* (const float &rhs) const
| Get the scalar multiple. More...
Vector3f | operator* (const Vector3f &vector) const
| Transform a Vector3f. More...
Matrix4f | operator*= (const Matrix4f &rhs)
| Get the product. More...
Matrix4f & | operator*= (const float &rhs)
| Set equal to the scalar multiple. More...
Matrix4f | operator+ (const Matrix4f &rhs) const
| Get the sum. More...
Matrix4f & | operator+= (const Matrix4f &rhs)
| Set equal to the sum. More...
Matrix4f | operator- (const Matrix4f &rhs) const
| Get the difference. More...
Matrix4f | operator- () const
| Get the negation. More...
Matrix4f & | operator-= (const Matrix4f &rhs)
| Set equal to the difference. More...
Matrix4f | operator/ (const Matrix4f &rhs) const
| Get the product with the inverse. More...
Matrix4f | operator/ (const float &rhs) const
| Get the scalar... something. More...
Matrix4f | operator/= (const Matrix4f &rhs)
| Set equal to the product with the inverse. More...
Matrix4f & | operator/= (const float &rhs)
| Set equal to the scalar something. More...
const Matrix4f_Row | operator[] (const int &index) const
| Get row 'index'. More...
Matrix4f_Row | operator[] (const int &index)
| Get row 'index'. More...
Matrix4f & | transpose ()
| Transpose the matrix. More...
Matrix4f | transposed () const
| Get the transpose. More...

## Static Public Member Functions

static Matrix4f | Frustum (const Point2f &upper_left, const Point2f &lower_right, const float &near, const float &far)
| Similar to glFrustum. More...
static Matrix4f | Identity ()
static Matrix4f | Orthographic (const float &left, const float &right, const float &bottom, const float &top, const float &near, const float &far)
| Similar to gluOrtho. More...
static Matrix4f | Perspective (const float &fov_rad_y, const float &aspect, const float &near, const float &far)
| Similar to gluPerspective. More...
static Matrix4f | Rotate (const Quaternion &rotation)
static Matrix4f | Scale (const Vector3f &scaling_factor)
static Matrix4f | Translate (const Vector3f &translation_factor)
static Matrix4f | View (const Point3f &position, const Vector3f &forward, const Vector3f &up)
| Similar to gluLookAt. More...
static Matrix4f | Zero ()

## Detailed Description

A Featureful 4-Space Matrix Class.

Matrix4f provides all the most basic functions of a Matrix class class: addition and subtraction, multiplication, scalar multiplication, inverse, transpose, and determinant. Additionally, it offers static creator functions for Zero and Identity matrices, and more advanced rendering-specific matrices as well.

Author
  bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 47 of file Matrix4f.h.

## Constructor & Destructor Documentation

Zeni::Matrix4f::Matrix4f | ( |  | ) |

Definition at line 25 of file Matrix4f.cpp.

References memset.

Referenced by Frustum(), Identity(), inverted(), Orthographic(), Perspective(), Scale(), Translate(), View(), and Zero().

Zeni::Matrix4f::Matrix4f | ( | const float & | aw,
|  | const float & | ax,
|  | const float & | ay,
|  | const float & | az,
|  | const float & | bw,
|  | const float & | bx,
|  | const float & | by,
|  | const float & | bz,
|  | const float & | cw,
|  | const float & | cx,
|  | const float & | cy,
|  | const float & | cz,
|  | const float & | dw,
|  | const float & | dx,
|  | const float & | dy,
|  | const float & | dz
| ) |  |

Definition at line 30 of file Matrix4f.cpp.

Zeni::Matrix4f::Matrix4f | ( | const Vector3f & | first,
|  | const Vector3f & | second,
|  | const Vector3f & | third,
|  | const bool & | rows = `false`
| ) |  |

Definition at line 57 of file Matrix4f.cpp.

References Zeni::Vector3f::i, Zeni::Vector3f::j, and Zeni::Vector3f::k.

Zeni::Matrix4f::Matrix4f | ( | const Matrix4f & | rhs | ) |

Definition at line 88 of file Matrix4f.cpp.

## Member Function Documentation

float Zeni::Matrix4f::determinant | ( |  | ) | const

Get the determinant.

Definition at line 153 of file Matrix4f.cpp.

References term.

Referenced by inverted().

Matrix4f Zeni::Matrix4f::Frustum | ( | const Point2f & | upper_left,
|  | const Point2f & | lower_right,
|  | const float & | near,
|  | const float & | far
| ) |  |

inlinestatic

Similar to glFrustum.

Definition at line 122 of file Matrix4f.hxx.

References Matrix4f(), Zeni::Point2f::x, and Zeni::Point2f::y.

Vector3f Zeni::Matrix4f::get_column | ( | const int & | column | ) | const

inline

Get a column of the upper-left 3x3 matrix.

Definition at line 275 of file Matrix4f.hxx.

References assert.

Vector3f Zeni::Matrix4f::get_row | ( | const int & | row | ) | const

inline

Get a row of the upper left 3x3 matrix.

Definition at line 280 of file Matrix4f.hxx.

References assert.

Matrix4f Zeni::Matrix4f::Identity | ( |  | ) |

inlinestatic

Definition at line 52 of file Matrix4f.hxx.

References Matrix4f().

Referenced by Zeni::Video::set_2d_view(), and Zeni::Video_DX9::set_3d_view().

Matrix4f & Zeni::Matrix4f::invert | ( |  | ) |

Invert the matrix.

Definition at line 93 of file Matrix4f.cpp.

References inverted().

Matrix4f Zeni::Matrix4f::inverted | ( |  | ) | const

Get the inverse.

Definition at line 98 of file Matrix4f.cpp.

References determinant(), m, and Matrix4f().

Referenced by invert(), operator/(), and operator/=().

Matrix4f Zeni::Matrix4f::operator* | ( | const Matrix4f & | rhs | ) | const

inline

Get the product.

Definition at line 202 of file Matrix4f.hxx.

References i, and j.

Matrix4f Zeni::Matrix4f::operator* | ( | const float & | rhs | ) | const

inline

Get the scalar multiple.

Definition at line 228 of file Matrix4f.hxx.

Vector3f Zeni::Matrix4f::operator* | ( | const Vector3f & | vector | ) | const

Transform a Vector3f.

Definition at line 179 of file Matrix4f.cpp.

References Zeni::Vector3f::i, Zeni::Vector3f::j, and Zeni::Vector3f::k.

Matrix4f Zeni::Matrix4f::operator*= | ( | const Matrix4f & | rhs | ) |

inline

Get the product.

Definition at line 216 of file Matrix4f.hxx.

Matrix4f & Zeni::Matrix4f::operator*= | ( | const float & | rhs | ) |

inline

Set equal to the scalar multiple.

Definition at line 250 of file Matrix4f.hxx.

Matrix4f Zeni::Matrix4f::operator+ | ( | const Matrix4f & | rhs | ) | const

inline

Get the sum.

Definition at line 154 of file Matrix4f.hxx.

Matrix4f & Zeni::Matrix4f::operator+= | ( | const Matrix4f & | rhs | ) |

inline

Set equal to the sum.

Definition at line 180 of file Matrix4f.hxx.

Matrix4f Zeni::Matrix4f::operator- | ( | const Matrix4f & | rhs | ) | const

inline

Get the difference.

Definition at line 167 of file Matrix4f.hxx.

Matrix4f Zeni::Matrix4f::operator- | ( |  | ) | const

inline

Get the negation.

Definition at line 264 of file Matrix4f.hxx.

Matrix4f & Zeni::Matrix4f::operator-= | ( | const Matrix4f & | rhs | ) |

inline

Set equal to the difference.

Definition at line 191 of file Matrix4f.hxx.

Matrix4f Zeni::Matrix4f::operator/ | ( | const Matrix4f & | rhs | ) | const

inline

Get the product with the inverse.

Definition at line 220 of file Matrix4f.hxx.

References inverted().

Matrix4f Zeni::Matrix4f::operator/ | ( | const float & | rhs | ) | const

inline

Get the scalar... something.

Definition at line 239 of file Matrix4f.hxx.

Matrix4f Zeni::Matrix4f::operator/= | ( | const Matrix4f & | rhs | ) |

inline

Set equal to the product with the inverse.

Definition at line 224 of file Matrix4f.hxx.

References inverted().

Matrix4f & Zeni::Matrix4f::operator/= | ( | const float & | rhs | ) |

inline

Set equal to the scalar something.

Definition at line 257 of file Matrix4f.hxx.

const Matrix4f::Matrix4f_Row Zeni::Matrix4f::operator[] | ( | const int & | index | ) | const

inline

Get row 'index'.

Definition at line 144 of file Matrix4f.hxx.

References assert.

Matrix4f::Matrix4f_Row Zeni::Matrix4f::operator[] | ( | const int & | index | ) |

inline

Get row 'index'.

Definition at line 149 of file Matrix4f.hxx.

References assert.

Matrix4f Zeni::Matrix4f::Orthographic | ( | const float & | left,
|  | const float & | right,
|  | const float & | bottom,
|  | const float & | top,
|  | const float & | near,
|  | const float & | far
| ) |  |

inlinestatic

Similar to gluOrtho.

Definition at line 89 of file Matrix4f.hxx.

References Matrix4f().

Referenced by Zeni::Video::set_2d_view().

Matrix4f Zeni::Matrix4f::Perspective | ( | const float & | fov_rad_y,
|  | const float & | aspect,
|  | const float & | near,
|  | const float & | far
| ) |  |

inlinestatic

Similar to gluPerspective.

Definition at line 104 of file Matrix4f.hxx.

References cotangent, and Matrix4f().

Referenced by Zeni::Camera::get_projection_matrix().

Matrix4f Zeni::Matrix4f::Rotate | ( | const Quaternion & | rotation | ) |

inlinestatic

Definition at line 66 of file Matrix4f.hxx.

References Zeni::Quaternion::get_matrix().

Matrix4f Zeni::Matrix4f::Scale | ( | const Vector3f & | scaling_factor | ) |

inlinestatic

Definition at line 59 of file Matrix4f.hxx.

References Zeni::Vector3f::i, Zeni::Vector3f::j, Zeni::Vector3f::k, and Matrix4f().

Referenced by Zeni::Video_DX9::set_2d_view(), and Zeni::Video_GL_Shader::set_projection_matrix().

Matrix4f Zeni::Matrix4f::Translate | ( | const Vector3f & | translation_factor | ) |

inlinestatic

Definition at line 70 of file Matrix4f.hxx.

References Zeni::Vector3f::i, Zeni::Vector3f::j, Zeni::Vector3f::k, and Matrix4f().

Referenced by Zeni::Video_DX9::set_2d_view(), and View().

Matrix4f & Zeni::Matrix4f::transpose | ( |  | ) |

Transpose the matrix.

Definition at line 130 of file Matrix4f.cpp.

References i, and j.

Matrix4f Zeni::Matrix4f::transposed | ( |  | ) | const

Get the transpose.

Definition at line 142 of file Matrix4f.cpp.

References i, and j.

Matrix4f Zeni::Matrix4f::View | ( | const Point3f & | position,
|  | const Vector3f & | forward,
|  | const Vector3f & | up
| ) |  |

inlinestatic

Similar to gluLookAt.

Definition at line 77 of file Matrix4f.hxx.

References Zeni::Vector3f::i, Zeni::Vector3f::j, Zeni::Vector3f::k, Matrix4f(), Zeni::Vector3f::normalized(), Translate(), and u.

Referenced by Zeni::Camera::get_view_matrix().

Matrix4f Zeni::Matrix4f::Zero | ( |  | ) |

inlinestatic

Definition at line 48 of file Matrix4f.hxx.

References Matrix4f().

The documentation for this class was generated from the following files:

- zenilib/jni/external/zenilib/zeni/Zeni/Matrix4f.h
- zenilib/jni/external/zenilib/zeni/Matrix4f.cpp
- zenilib/jni/external/zenilib/zeni/Zeni/Matrix4f.hxx