# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes

# vl::Matrix4< T_Scalar > Class Template Reference

The Matrix4 class is a template class that implements a generic 4x4 matrix, see also vl::dmat4, vl::fmat4, vl::umat4, vl::imat4. More...

`#include <Matrix4.hpp>`

List of all members.

## Public Types

typedef T_Scalar | scalar_type

## Public Member Functions

template<typename T >
| Matrix4 (const Matrix4< T > &m)
| Matrix4 ()
| Matrix4 (T_Scalar n)
| Matrix4 (T_Scalar e00, T_Scalar e01, T_Scalar e02, T_Scalar e03, T_Scalar e10, T_Scalar e11, T_Scalar e12, T_Scalar e13, T_Scalar e20, T_Scalar e21, T_Scalar e22, T_Scalar e23, T_Scalar e30, T_Scalar e31, T_Scalar e32, T_Scalar e33)
Matrix4 & | fill (T_Scalar val)
T_Scalar | diff (const Matrix4 &other) const
Vector3< T_Scalar > | getX () const
Vector3< T_Scalar > | getY () const
Vector3< T_Scalar > | getZ () const
Vector3< T_Scalar > | getT () const
Matrix4 & | setX (const Vector3< T_Scalar > &v)
Matrix4 & | setY (const Vector3< T_Scalar > &v)
Matrix4 & | setZ (const Vector3< T_Scalar > &v)
Matrix4 & | setT (const Vector3< T_Scalar > &v)
bool | operator== (const Matrix4 &m) const
bool | operator!= (const Matrix4 &m) const
Matrix4 & | operator= (const Matrix4 &m)
Matrix4 | operator+ (const Matrix4 &m) const
Matrix4 & | operator+= (const Matrix4 &m)
Matrix4 | operator- (const Matrix4 &m) const
Matrix4 & | operator-= (const Matrix4 &m)
Matrix4 & | operator*= (const Matrix4 &m)
Matrix4 | operator- () const
Matrix4 | operator+ (T_Scalar d) const
Matrix4 & | operator+= (T_Scalar d)
Matrix4 | operator- (T_Scalar d) const
Matrix4 & | operator-= (T_Scalar d)
Matrix4 | operator* (T_Scalar d) const
Matrix4 & | operator*= (T_Scalar d)
Matrix4 | operator/ (T_Scalar d) const
Matrix4 & | operator/= (T_Scalar d)
bool | isIdentity () const
Matrix4 | as3x3 () const
Matrix3< T_Scalar > | get3x3 () const
void | set3x3 (const Matrix3< T_Scalar > &m)
| This writes only on the upper 3x3 part of the matrix without touching the last row and column.
T_Scalar * | ptr ()
const T_Scalar * | ptr () const
Matrix4 & | transpose ()
Matrix4 | getTransposed () const
Matrix4 & | getTransposed (Matrix4 &dest) const
bool | isNull () const
Matrix4 & | setNull ()
Matrix4 & | setIdentity ()
T_Scalar | getInverse (Matrix4 &dest) const
Matrix4 | getInverse (T_Scalar *determinant=NULL) const
Matrix4 & | invert (T_Scalar *determinant=NULL)
void | getAsLookAt (Vector3< T_Scalar > &eye, Vector3< T_Scalar > &look, Vector3< T_Scalar > &up, Vector3< T_Scalar > &right) const
void | getYXRotationAngles (T_Scalar &degrees_y, T_Scalar &degrees_x) const
| If this matrix can be represented as `RY(degrees_y)` * `RX(degrees_x)`, where RX and RY are getRotation matrices around the X and Y axis respectively, this function returns the getRotation angles `degrees_y` and `degrees_x`.
Matrix4 & | rotate (T_Scalar degrees, const Vector3< T_Scalar > &v)
Matrix4 & | rotate (T_Scalar degrees, T_Scalar x, T_Scalar y, T_Scalar z)
Matrix4 & | rotate (T_Scalar degrees1, const Vector3< T_Scalar > &v1, T_Scalar degrees2, const Vector3< T_Scalar > &v2)
Matrix4 & | rotate (T_Scalar degrees1, const Vector3< T_Scalar > &v1, T_Scalar degrees2, const Vector3< T_Scalar > &v2, T_Scalar degrees3, const Vector3< T_Scalar > &v3)
Matrix4 & | rotateXYZ (T_Scalar degX, T_Scalar degY, T_Scalar degZ)
Matrix4 & | rotateZYX (T_Scalar degZ, T_Scalar degY, T_Scalar degX)
Matrix4 & | rotate (const Vector4< T_Scalar > &from, const Vector4< T_Scalar > &to)
Matrix4 & | rotate (const Vector3< T_Scalar > &from, const Vector3< T_Scalar > &to)
Matrix4 & | translate (T_Scalar x, T_Scalar y, T_Scalar z)
Matrix4 & | translate (const Vector3< T_Scalar > &v)
Matrix4 & | scale (T_Scalar x, T_Scalar y, T_Scalar z)
Matrix4 & | scale (const Vector3< T_Scalar > v)
Matrix4 & | postMultiply (const Matrix4 &m)
Matrix4 & | preMultiply (const Matrix4 &m)
const T_Scalar & | e (int i, int j) const
T_Scalar & | e (int i, int j)

## Static Public Member Functions

static Matrix4 & | getNull (Matrix4 &out)
static Matrix4 | getNull ()
static Matrix4 | getIdentity ()
static Matrix4 & | getIdentity (Matrix4 &out)
static Matrix4 | getPerspective (T_Scalar fovy, T_Scalar aspect_ratio, T_Scalar znear, T_Scalar zfar)
static Matrix4 | getFrustum (T_Scalar pleft, T_Scalar pright, T_Scalar pbottom, T_Scalar ptop, T_Scalar pnear, T_Scalar pfar)
static Matrix4 | getOrtho (T_Scalar pleft, T_Scalar pright, T_Scalar pbottom, T_Scalar ptop, T_Scalar pnear, T_Scalar pfar)
static Matrix4 | getOrtho2D (T_Scalar pleft, T_Scalar pright, T_Scalar pbottom, T_Scalar ptop)
static Matrix4 | getLookAt (const Vector3< T_Scalar > &eye, const Vector3< T_Scalar > &look, const Vector3< T_Scalar > &up)
static Matrix4 & | getRotation (Matrix4 &out, T_Scalar degrees, T_Scalar x, T_Scalar y, T_Scalar z)
static Matrix4 | getRotation (T_Scalar degrees, T_Scalar x, T_Scalar y, T_Scalar z)
static Matrix4 | getRotation (T_Scalar degrees, const Vector3< T_Scalar > &v)
static Matrix4 | getRotation (T_Scalar degrees1, const Vector3< T_Scalar > &v1, T_Scalar degrees2, const Vector3< T_Scalar > &v2)
static Matrix4 | getRotation (T_Scalar degrees1, const Vector3< T_Scalar > &v1, T_Scalar degrees2, const Vector3< T_Scalar > &v2, T_Scalar degrees3, const Vector3< T_Scalar > &v3)
static Matrix4 | getRotationXYZ (T_Scalar degX, T_Scalar degY, T_Scalar degZ)
static Matrix4 | getRotationZYX (T_Scalar degZ, T_Scalar degY, T_Scalar degX)
static Matrix4 & | getRotation (Matrix4 &out, const Vector3< T_Scalar > &from, const Vector3< T_Scalar > &to)
static Matrix4 | getRotation (const Vector3< T_Scalar > &from, const Vector3< T_Scalar > &to)
static Matrix4 & | getTranslation (Matrix4 &out, const Vector3< T_Scalar > &v)
static Matrix4 | getTranslation (const Vector3< T_Scalar > &v)
static Matrix4 | getTranslation (T_Scalar x, T_Scalar y, T_Scalar z)
static Matrix4 & | getTranslation (Matrix4 &out, T_Scalar x, T_Scalar y, T_Scalar z)
static Matrix4 & | getScaling (Matrix4 &out, const Vector3< T_Scalar > &v)
static Matrix4 | getScaling (const Vector3< T_Scalar > &v)
static Matrix4 | getScaling (T_Scalar x, T_Scalar y, T_Scalar z)
static Matrix4 & | getScaling (Matrix4 &out, T_Scalar x, T_Scalar y, T_Scalar z)
static Matrix4 & | multiply (Matrix4 &out, const Matrix4 &p, const Matrix4 &q)

## Protected Attributes

Vector4< T_Scalar > | mVec [4]

## Detailed Description

### template<typename T_Scalar>
class vl::Matrix4< T_Scalar >

The Matrix4 class is a template class that implements a generic 4x4 matrix, see also vl::dmat4, vl::fmat4, vl::umat4, vl::imat4.

See also:
  Vector4, Vector3, Vector2, Matrix3, Matrix2

Definition at line 48 of file Matrix4.hpp.

## Member Typedef Documentation

template<typename T_Scalar>

typedef T_Scalar vl::Matrix4< T_Scalar >::scalar_type

Definition at line 51 of file Matrix4.hpp.

## Constructor & Destructor Documentation

template<typename T_Scalar>
template<typename T >

vl::Matrix4< T_Scalar >::Matrix4 | ( | const Matrix4< T > & | m ) | `[inline, explicit]`

Definition at line 54 of file Matrix4.hpp.

template<typename T_Scalar>

vl::Matrix4< T_Scalar >::Matrix4 | ( | ) | `[inline]`

Definition at line 62 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::getIdentity(), and vl::Matrix4< GLfloat >::getNull().

template<typename T_Scalar>

vl::Matrix4< T_Scalar >::Matrix4 | ( | T_Scalar | n ) | `[inline, explicit]`

Definition at line 67 of file Matrix4.hpp.

template<typename T_Scalar>

vl::Matrix4< T_Scalar >::Matrix4 | ( | T_Scalar | e00,
|  | T_Scalar | e01,
|  | T_Scalar | e02,
|  | T_Scalar | e03,
|  | T_Scalar | e10,
|  | T_Scalar | e11,
|  | T_Scalar | e12,
|  | T_Scalar | e13,
|  | T_Scalar | e20,
|  | T_Scalar | e21,
|  | T_Scalar | e22,
|  | T_Scalar | e23,
|  | T_Scalar | e30,
|  | T_Scalar | e31,
|  | T_Scalar | e32,
|  | T_Scalar | e33
| ) |  | `[inline, explicit]`

Definition at line 73 of file Matrix4.hpp.

## Member Function Documentation

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::fill | ( | T_Scalar | val ) | `[inline]`

Definition at line 84 of file Matrix4.hpp.

Referenced by vl::Matrix4< T_Scalar >::getInverse(), vl::Matrix4< GLfloat >::getNull(), vl::SlicedVolume::setBox(), and vl::Matrix4< GLfloat >::setNull().

template<typename T_Scalar>

T_Scalar vl::Matrix4< T_Scalar >::diff | ( | const Matrix4< T_Scalar > & | other ) | const`[inline]`

Definition at line 93 of file Matrix4.hpp.

template<typename T_Scalar>

Vector3<T_Scalar> vl::Matrix4< T_Scalar >::getX | ( | ) | const`[inline]`

Definition at line 105 of file Matrix4.hpp.

Referenced by vl::TrackballManipulator::mouseMoveEvent(), and vl::GhostCameraManipulator::updateEvent().

template<typename T_Scalar>

Vector3<T_Scalar> vl::Matrix4< T_Scalar >::getY | ( | ) | const`[inline]`

Definition at line 110 of file Matrix4.hpp.

Referenced by vl::Billboard::computeWorldMatrix(), vl::TrackballManipulator::mouseMoveEvent(), and vl::GhostCameraManipulator::updateEvent().

template<typename T_Scalar>

Vector3<T_Scalar> vl::Matrix4< T_Scalar >::getZ | ( | ) | const`[inline]`

Definition at line 115 of file Matrix4.hpp.

Referenced by vl::Camera::adjustView(), vl::Billboard::computeWorldMatrix(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::updateEvent(), and vl::RaycastVolume::updateUniforms().

template<typename T_Scalar>

Vector3<T_Scalar> vl::Matrix4< T_Scalar >::getT | ( | ) | const`[inline]`

Definition at line 120 of file Matrix4.hpp.

Referenced by vl::Camera::adjustView(), vl::Camera::computeRay(), vl::SceneManagerPortals::computeStartingSector(), vl::Billboard::computeWorldMatrix(), vl::DistanceLODEvaluator::evaluate(), vl::SceneManagerPortals::extractVisibleActors(), vl::TrackballManipulator::mouseDownEvent(), vl::Billboard::position(), vl::OcclusionCullRenderer::render_pass2(), vl::SlicedVolume::updateUniforms(), and vl::RaycastVolume::updateUniforms().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::setX | ( | const Vector3< T_Scalar > & | v ) | `[inline]`

Definition at line 125 of file Matrix4.hpp.

Referenced by vl::Billboard::computeWorldMatrix(), vl::Matrix4< T_Scalar >::getLookAt(), and vl::A3DSLoader::read_TRIANGULAR_MESH().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::setY | ( | const Vector3< T_Scalar > & | v ) | `[inline]`

Definition at line 133 of file Matrix4.hpp.

Referenced by vl::Billboard::computeWorldMatrix(), vl::Matrix4< T_Scalar >::getLookAt(), and vl::A3DSLoader::read_TRIANGULAR_MESH().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::setZ | ( | const Vector3< T_Scalar > & | v ) | `[inline]`

Definition at line 141 of file Matrix4.hpp.

Referenced by vl::Billboard::computeWorldMatrix(), vl::Matrix4< T_Scalar >::getLookAt(), and vl::A3DSLoader::read_TRIANGULAR_MESH().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::setT | ( | const Vector3< T_Scalar > & | v ) | `[inline]`

Definition at line 149 of file Matrix4.hpp.

Referenced by vl::Matrix4< T_Scalar >::getLookAt(), vl::TrackballManipulator::mouseMoveEvent(), and vl::A3DSLoader::read_TRIANGULAR_MESH().

template<typename T_Scalar>

bool vl::Matrix4< T_Scalar >::operator== | ( | const Matrix4< T_Scalar > & | m ) | const`[inline]`

Definition at line 157 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::operator!=().

template<typename T_Scalar>

bool vl::Matrix4< T_Scalar >::operator!= | ( | const Matrix4< T_Scalar > & | m ) | const`[inline]`

Definition at line 162 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator= | ( | const Matrix4< T_Scalar > & | m ) | `[inline]`

Definition at line 167 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator+ | ( | const Matrix4< T_Scalar > & | m ) | const`[inline]`

Definition at line 173 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator+= | ( | const Matrix4< T_Scalar > & | m ) | `[inline]`

Definition at line 183 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator- | ( | const Matrix4< T_Scalar > & | m ) | const`[inline]`

Definition at line 191 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator-= | ( | const Matrix4< T_Scalar > & | m ) | `[inline]`

Definition at line 201 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator*= | ( | const Matrix4< T_Scalar > & | m ) | `[inline]`

Definition at line 209 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator- | ( | ) | const`[inline]`

Definition at line 214 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator+ | ( | T_Scalar | d ) | const`[inline]`

Definition at line 223 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator+= | ( | T_Scalar | d ) | `[inline]`

Definition at line 232 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator- | ( | T_Scalar | d ) | const`[inline]`

Definition at line 240 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator-= | ( | T_Scalar | d ) | `[inline]`

Definition at line 249 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator* | ( | T_Scalar | d ) | const`[inline]`

Definition at line 257 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator*= | ( | T_Scalar | d ) | `[inline]`

Definition at line 266 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::operator/ | ( | T_Scalar | d ) | const`[inline]`

Definition at line 274 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::operator/= | ( | T_Scalar | d ) | `[inline]`

Definition at line 284 of file Matrix4.hpp.

template<typename T_Scalar>

bool vl::Matrix4< T_Scalar >::isIdentity | ( | ) | const`[inline]`

Definition at line 293 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::as3x3 | ( | ) | const`[inline]`

Definition at line 299 of file Matrix4.hpp.

Referenced by vl::TextureMatrix::apply(), vl::EdgeUpdateCallback::onActorRenderStarted(), vl::Geometry::transform(), and vl::ProjViewTransfCallback::updateMatrices().

template<typename T_Scalar>

Matrix3<T_Scalar> vl::Matrix4< T_Scalar >::get3x3 | ( | ) | const`[inline]`

Definition at line 312 of file Matrix4.hpp.

Referenced by vl::Quaternion< T_Scalar >::setFromMatrix(), and vl::TrackballManipulator::trackballRotation().

template<typename T_Scalar>

void vl::Matrix4< T_Scalar >::set3x3 | ( | const Matrix3< T_Scalar > & | m ) | `[inline]`

This writes only on the upper 3x3 part of the matrix without touching the last row and column.

Definition at line 322 of file Matrix4.hpp.

template<typename T_Scalar>

T_Scalar* vl::Matrix4< T_Scalar >::ptr | ( | ) | `[inline]`

Definition at line 329 of file Matrix4.hpp.

Referenced by vl::Camera::applyModelViewMatrix(), vl::Camera::applyViewMatrix(), vl::Uniform::getUniform(), vl::GLSLProgram::getUniform(), vl::Matrix4< GLfloat >::isIdentity(), vl::Matrix4< GLfloat >::multiply(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::EdgeRenderer::renderLines(), vl::EdgeRenderer::renderSolids(), vl::Text::renderText(), vl::Uniform::setUniform(), and vl::ProjViewTransfCallback::updateMatrices().

template<typename T_Scalar>

const T_Scalar* vl::Matrix4< T_Scalar >::ptr | ( | ) | const`[inline]`

Definition at line 334 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::transpose | ( | ) | `[inline]`

Definition at line 339 of file Matrix4.hpp.

Referenced by vl::ProjViewTransfCallback::updateMatrices().

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::getTransposed | ( | ) | const`[inline]`

Definition at line 352 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::getTransposed | ( | Matrix4< T_Scalar > & | dest ) | const`[inline]`

Definition at line 361 of file Matrix4.hpp.

template<typename T_Scalar>

bool vl::Matrix4< T_Scalar >::isNull | ( | ) | const`[inline]`

Definition at line 369 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::setNull | ( | ) | `[inline]`

Definition at line 378 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::getNull | ( | Matrix4< T_Scalar > & | out ) | `[inline, static]`

Definition at line 384 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getNull | ( | ) | `[inline, static]`

Definition at line 390 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::setIdentity | ( | ) | `[inline]`

Definition at line 395 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::getIdentity(), vl::Matrix4< T_Scalar >::getRotation(), vl::Matrix4< GLfloat >::getScaling(), vl::Matrix4< GLfloat >::getTranslation(), vl::Matrix4< GLfloat >::Matrix4(), and vl::Text::resetMatrix().

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getIdentity | ( | ) | `[inline, static]`

Definition at line 408 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::getIdentity | ( | Matrix4< T_Scalar > & | out ) | `[inline, static]`

Definition at line 413 of file Matrix4.hpp.

template<typename T_Scalar >

T_Scalar vl::Matrix4< T_Scalar >::getInverse | ( | Matrix4< T_Scalar > & | dest ) | const

Definition at line 966 of file Matrix4.hpp.

References vl::Matrix4< T_Scalar >::fill().

Referenced by vl::Matrix4< GLfloat >::getInverse(), vl::Matrix4< GLfloat >::invert(), vl::SlicedVolume::onActorRenderStarted(), vl::EdgeUpdateCallback::onActorRenderStarted(), vl::Geometry::transform(), vl::SlicedVolume::updateUniforms(), and vl::RaycastVolume::updateUniforms().

template<typename T_Scalar>

Matrix4 vl::Matrix4< T_Scalar >::getInverse | ( | T_Scalar * | determinant = `NULL` ) | const`[inline]`

Definition at line 421 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::invert | ( | T_Scalar * | determinant = `NULL` ) | `[inline]`

Definition at line 430 of file Matrix4.hpp.

Referenced by vl::Camera::setInverseViewMatrix(), vl::Camera::setViewMatrix(), and vl::ProjViewTransfCallback::updateMatrices().

template<typename T_Scalar>

Matrix4< T_Scalar > vl::Matrix4< T_Scalar >::getPerspective | ( | T_Scalar | fovy,
|  | T_Scalar | aspect_ratio,
|  | T_Scalar | znear,
|  | T_Scalar | zfar
| ) |  | `[static]`

Definition at line 782 of file Matrix4.hpp.

References vl::cos(), vl::dDEG_TO_RAD, vl::Matrix4< T_Scalar >::e(), and vl::sin().

template<typename T_Scalar>

Matrix4< T_Scalar > vl::Matrix4< T_Scalar >::getFrustum | ( | T_Scalar | pleft,
|  | T_Scalar | pright,
|  | T_Scalar | pbottom,
|  | T_Scalar | ptop,
|  | T_Scalar | pnear,
|  | T_Scalar | pfar
| ) |  | `[static]`

Definition at line 804 of file Matrix4.hpp.

References vl::Matrix4< T_Scalar >::e().

template<typename T_Scalar>

Matrix4< T_Scalar > vl::Matrix4< T_Scalar >::getOrtho | ( | T_Scalar | pleft,
|  | T_Scalar | pright,
|  | T_Scalar | pbottom,
|  | T_Scalar | ptop,
|  | T_Scalar | pnear,
|  | T_Scalar | pfar
| ) |  | `[static]`

Definition at line 827 of file Matrix4.hpp.

References vl::Matrix4< T_Scalar >::e().

template<typename T_Scalar>

Matrix4< T_Scalar > vl::Matrix4< T_Scalar >::getOrtho2D | ( | T_Scalar | pleft,
|  | T_Scalar | pright,
|  | T_Scalar | pbottom,
|  | T_Scalar | ptop
| ) |  | `[static]`

Definition at line 855 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4< T_Scalar > vl::Matrix4< T_Scalar >::getLookAt | ( | const Vector3< T_Scalar > & | eye,
|  | const Vector3< T_Scalar > & | look,
|  | const Vector3< T_Scalar > & | up
| ) |  | `[static]`

Definition at line 749 of file Matrix4.hpp.

References vl::cross(), vl::Vector3< T_Scalar >::normalize(), vl::normalize(), vl::Matrix4< T_Scalar >::setT(), vl::Matrix4< T_Scalar >::setX(), vl::Matrix4< T_Scalar >::setY(), and vl::Matrix4< T_Scalar >::setZ().

template<typename T_Scalar>

void vl::Matrix4< T_Scalar >::getAsLookAt | ( | Vector3< T_Scalar > & | eye,
|  | Vector3< T_Scalar > & | look,
|  | Vector3< T_Scalar > & | up,
|  | Vector3< T_Scalar > & | right
| ) |  | const

Definition at line 767 of file Matrix4.hpp.

References vl::Vector3< T_Scalar >::normalize().

Referenced by vl::Camera::getViewMatrixAsLookAt().

template<typename T_Scalar>

void vl::Matrix4< T_Scalar >::getYXRotationAngles | ( | T_Scalar & | degrees_y,
|  | T_Scalar & | degrees_x
| ) |  | const

If this matrix can be represented as `RY(degrees_y)` * `RX(degrees_x)`, where RX and RY are getRotation matrices around the X and Y axis respectively, this function returns the getRotation angles `degrees_y` and `degrees_x`.

Note:
  This function can only retrieve angles that satisfy the following conditions:
  - -180 <= degrees_y <= 180
  - -180 <= degrees_x <= 180 and degrees_x != 90

Definition at line 1105 of file Matrix4.hpp.

References vl::acos(), vl::clamp(), vl::dot(), vl::dRAD_TO_DEG, and vl::Vector3< T_Scalar >::normalize().

Referenced by vl::GhostCameraManipulator::enableEvent().

template<typename T_Scalar>

Matrix4< T_Scalar > & vl::Matrix4< T_Scalar >::getRotation | ( | Matrix4< T_Scalar > & | out,
|  | T_Scalar | degrees,
|  | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[static]`

Definition at line 861 of file Matrix4.hpp.

References vl::cos(), vl::dDEG_TO_RAD, vl::dot(), vl::Matrix4< T_Scalar >::e(), vl::Matrix4< T_Scalar >::setIdentity(), vl::sin(), and vl::sqrt().

Referenced by vl::Matrix4< GLfloat >::getRotation(), vl::Matrix4< GLfloat >::getRotationXYZ(), vl::Matrix4< GLfloat >::getRotationZYX(), and vl::Matrix4< GLfloat >::rotate().

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotation | ( | T_Scalar | degrees,
|  | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline, static]`

Definition at line 454 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotation | ( | T_Scalar | degrees,
|  | const Vector3< T_Scalar > & | v
| ) |  | `[inline, static]`

Definition at line 460 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotation | ( | T_Scalar | degrees1,
|  | const Vector3< T_Scalar > & | v1,
|  | T_Scalar | degrees2,
|  | const Vector3< T_Scalar > & | v2
| ) |  | `[inline, static]`

Definition at line 465 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotation | ( | T_Scalar | degrees1,
|  | const Vector3< T_Scalar > & | v1,
|  | T_Scalar | degrees2,
|  | const Vector3< T_Scalar > & | v2,
|  | T_Scalar | degrees3,
|  | const Vector3< T_Scalar > & | v3
| ) |  | `[inline, static]`

Definition at line 470 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotate | ( | T_Scalar | degrees,
|  | const Vector3< T_Scalar > & | v
| ) |  | `[inline]`

Definition at line 475 of file Matrix4.hpp.

Referenced by vl::Text::rotate(), and vl::Matrix4< GLfloat >::rotate().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotate | ( | T_Scalar | degrees,
|  | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline]`

Definition at line 480 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotate | ( | T_Scalar | degrees1,
|  | const Vector3< T_Scalar > & | v1,
|  | T_Scalar | degrees2,
|  | const Vector3< T_Scalar > & | v2
| ) |  | `[inline]`

Definition at line 485 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotate | ( | T_Scalar | degrees1,
|  | const Vector3< T_Scalar > & | v1,
|  | T_Scalar | degrees2,
|  | const Vector3< T_Scalar > & | v2,
|  | T_Scalar | degrees3,
|  | const Vector3< T_Scalar > & | v3
| ) |  | `[inline]`

Definition at line 490 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotationXYZ | ( | T_Scalar | degX,
|  | T_Scalar | degY,
|  | T_Scalar | degZ
| ) |  | `[inline, static]`

Definition at line 495 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::rotateXYZ().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotateXYZ | ( | T_Scalar | degX,
|  | T_Scalar | degY,
|  | T_Scalar | degZ
| ) |  | `[inline]`

Definition at line 500 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotationZYX | ( | T_Scalar | degZ,
|  | T_Scalar | degY,
|  | T_Scalar | degX
| ) |  | `[inline, static]`

Definition at line 505 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::rotateZYX().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotateZYX | ( | T_Scalar | degZ,
|  | T_Scalar | degY,
|  | T_Scalar | degX
| ) |  | `[inline]`

Definition at line 510 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4< T_Scalar > & vl::Matrix4< T_Scalar >::getRotation | ( | Matrix4< T_Scalar > & | out,
|  | const Vector3< T_Scalar > & | from,
|  | const Vector3< T_Scalar > & | to
| ) |  | `[static]`

Definition at line 1082 of file Matrix4.hpp.

References vl::acos(), vl::clamp(), vl::cross(), vl::dot(), vl::dRAD_TO_DEG, vl::Vector3< T_Scalar >::normalize(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getRotation | ( | const Vector3< T_Scalar > & | from,
|  | const Vector3< T_Scalar > & | to
| ) |  | `[inline, static]`

Definition at line 517 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotate | ( | const Vector4< T_Scalar > & | from,
|  | const Vector4< T_Scalar > & | to
| ) |  | `[inline]`

Definition at line 523 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::rotate | ( | const Vector3< T_Scalar > & | from,
|  | const Vector3< T_Scalar > & | to
| ) |  | `[inline]`

Definition at line 528 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::getTranslation | ( | Matrix4< T_Scalar > & | out,
|  | const Vector3< T_Scalar > & | v
| ) |  | `[inline, static]`

Definition at line 533 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::getTranslation(), and vl::Matrix4< GLfloat >::translate().

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getTranslation | ( | const Vector3< T_Scalar > & | v ) | `[inline, static]`

Definition at line 538 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getTranslation | ( | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline, static]`

Definition at line 544 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::getTranslation | ( | Matrix4< T_Scalar > & | out,
|  | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline, static]`

Definition at line 550 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::translate | ( | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline]`

Definition at line 559 of file Matrix4.hpp.

Referenced by vl::Text::boundingRectTransformed(), vl::Terrain::init(), vl::Text::renderText(), and vl::Text::translate().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::translate | ( | const Vector3< T_Scalar > & | v ) | `[inline]`

Definition at line 564 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::getScaling | ( | Matrix4< T_Scalar > & | out,
|  | const Vector3< T_Scalar > & | v
| ) |  | `[inline, static]`

Definition at line 569 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::getScaling(), and vl::Matrix4< GLfloat >::scale().

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getScaling | ( | const Vector3< T_Scalar > & | v ) | `[inline, static]`

Definition at line 574 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4 vl::Matrix4< T_Scalar >::getScaling | ( | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline, static]`

Definition at line 580 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::getScaling | ( | Matrix4< T_Scalar > & | out,
|  | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline, static]`

Definition at line 586 of file Matrix4.hpp.

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::scale | ( | T_Scalar | x,
|  | T_Scalar | y,
|  | T_Scalar | z
| ) |  | `[inline]`

Definition at line 595 of file Matrix4.hpp.

Referenced by vl::Terrain::init().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::scale | ( | const Vector3< T_Scalar > | v ) | `[inline]`

Definition at line 600 of file Matrix4.hpp.

template<typename T_Scalar>

static Matrix4& vl::Matrix4< T_Scalar >::multiply | ( | Matrix4< T_Scalar > & | out,
|  | const Matrix4< T_Scalar > & | p,
|  | const Matrix4< T_Scalar > & | q
| ) |  | `[inline, static]`

Definition at line 605 of file Matrix4.hpp.

Referenced by vl::operator*(), vl::Matrix4< GLfloat >::postMultiply(), and vl::Matrix4< GLfloat >::preMultiply().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::postMultiply | ( | const Matrix4< T_Scalar > & | m ) | `[inline]`

Definition at line 632 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::operator*=().

template<typename T_Scalar>

Matrix4& vl::Matrix4< T_Scalar >::preMultiply | ( | const Matrix4< T_Scalar > & | m ) | `[inline]`

Definition at line 638 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::rotate(), vl::Matrix4< GLfloat >::rotateXYZ(), vl::Matrix4< GLfloat >::rotateZYX(), vl::Matrix4< GLfloat >::scale(), and vl::Matrix4< GLfloat >::translate().

template<typename T_Scalar>

const T_Scalar& vl::Matrix4< T_Scalar >::e | ( | int | i,
|  | int | j
| ) |  | const`[inline]`

Definition at line 645 of file Matrix4.hpp.

Referenced by vl::Camera::applyModelViewMatrix(), vl::Camera::applyViewMatrix(), vl::Matrix4< GLfloat >::diff(), vl::extractPlanes(), vl::Matrix4< GLfloat >::fill(), vl::Matrix4< GLfloat >::get3x3(), vl::Matrix4< T_Scalar >::getFrustum(), vl::Matrix4< T_Scalar >::getOrtho(), vl::Matrix4< T_Scalar >::getPerspective(), vl::Matrix4< T_Scalar >::getRotation(), vl::Matrix4< GLfloat >::getScaling(), vl::Matrix4< GLfloat >::getTranslation(), vl::Matrix4< GLfloat >::getTransposed(), vl::Matrix4< GLfloat >::isNull(), vl::Matrix4< GLfloat >::Matrix4(), vl::matrixCompMult(), vl::Matrix4< GLfloat >::multiply(), vl::operator*(), vl::Matrix4< GLfloat >::operator*(), vl::Matrix4< GLfloat >::operator*=(), vl::Matrix4< GLfloat >::operator+(), vl::Matrix4< GLfloat >::operator+=(), vl::Matrix4< GLfloat >::operator-(), vl::Matrix4< GLfloat >::operator-=(), vl::Matrix4< GLfloat >::operator/(), vl::Matrix4< GLfloat >::operator/=(), vl::outerProduct(), vl::Matrix4< GLfloat >::ptr(), vl::Text::renderBackground(), vl::Text::renderBorder(), vl::Text::renderText(), vl::Matrix4< GLfloat >::set3x3(), vl::Matrix4< GLfloat >::transpose(), and vl::transpose().

template<typename T_Scalar>

T_Scalar& vl::Matrix4< T_Scalar >::e | ( | int | i,
|  | int | j
| ) |  | `[inline]`

Definition at line 646 of file Matrix4.hpp.

## Member Data Documentation

template<typename T_Scalar>

Vector4<T_Scalar> vl::Matrix4< T_Scalar >::mVec[4]`[protected]`

Definition at line 653 of file Matrix4.hpp.

Referenced by vl::Matrix4< GLfloat >::e(), vl::Matrix4< GLfloat >::getT(), vl::Matrix4< GLfloat >::getX(), vl::Matrix4< GLfloat >::getY(), vl::Matrix4< GLfloat >::getZ(), vl::Matrix4< GLfloat >::operator=(), vl::Matrix4< GLfloat >::operator==(), vl::Matrix4< GLfloat >::setIdentity(), vl::Matrix4< GLfloat >::setT(), vl::Matrix4< GLfloat >::setX(), vl::Matrix4< GLfloat >::setY(), and vl::Matrix4< GLfloat >::setZ().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/Matrix4.hpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:33.
Permission is granted to use this page to write and publish articles regarding Visualization Library.