cocos2d-x  3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Mat4 Class Reference

Copyright 2013 BlackBerry Inc. More...

#include <Mat4.h>

Public Member Functions

 Mat4 ()
 Constructs a matrix initialized to the identity matrix: More...
 
 Mat4 (float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)
 Constructs a matrix initialized to the specified value. More...
 
 Mat4 (const float *mat)
 Creates a matrix initialized to the specified column-major array. More...
 
 Mat4 (const Mat4 &copy)
 Constructs a new matrix by copying the values from the specified matrix. More...
 
 ~Mat4 ()
 Destructor. More...
 
void add (float scalar)
 Adds a scalar value to each component of this matrix. More...
 
void add (float scalar, Mat4 *dst)
 Adds a scalar value to each component of this matrix and stores the result in dst. More...
 
void add (const Mat4 &mat)
 Adds the specified matrix to this matrix. More...
 
var add ( var mat)
 Adds the specified matrix to this matrix. More...
 
local add ( local mat)
 Adds the specified matrix to this matrix. More...
 
bool decompose (Vec3 *scale, Quaternion *rotation, Vec3 *translation) const
 Decomposes the scale, rotation and translation components of this matrix. More...
 
float determinant () const
 Computes the determinant of this matrix. More...
 
var determinant ()
 Computes the determinant of this matrix. More...
 
local determinant ()
 Computes the determinant of this matrix. More...
 
void getScale (Vec3 *scale) const
 Gets the scalar component of this matrix in the specified vector. More...
 
bool getRotation (Quaternion *rotation) const
 Gets the rotational component of this matrix in the specified quaternion. More...
 
void getTranslation (Vec3 *translation) const
 Gets the translational component of this matrix in the specified vector. More...
 
void getUpVector (Vec3 *dst) const
 Gets the up vector of this matrix. More...
 
var getUpVector ( var dst)
 Gets the up vector of this matrix. More...
 
local getUpVector ( local dst)
 Gets the up vector of this matrix. More...
 
void getDownVector (Vec3 *dst) const
 Gets the down vector of this matrix. More...
 
var getDownVector ( var dst)
 Gets the down vector of this matrix. More...
 
local getDownVector ( local dst)
 Gets the down vector of this matrix. More...
 
void getLeftVector (Vec3 *dst) const
 Gets the left vector of this matrix. More...
 
var getLeftVector ( var dst)
 Gets the left vector of this matrix. More...
 
local getLeftVector ( local dst)
 Gets the left vector of this matrix. More...
 
void getRightVector (Vec3 *dst) const
 Gets the right vector of this matrix. More...
 
var getRightVector ( var dst)
 Gets the right vector of this matrix. More...
 
local getRightVector ( local dst)
 Gets the right vector of this matrix. More...
 
void getForwardVector (Vec3 *dst) const
 Gets the forward vector of this matrix. More...
 
var getForwardVector ( var dst)
 Gets the forward vector of this matrix. More...
 
local getForwardVector ( local dst)
 Gets the forward vector of this matrix. More...
 
void getBackVector (Vec3 *dst) const
 Gets the backward vector of this matrix. More...
 
var getBackVector ( var dst)
 Gets the backward vector of this matrix. More...
 
local getBackVector ( local dst)
 Gets the backward vector of this matrix. More...
 
bool inverse ()
 Inverts this matrix. More...
 
Mat4 getInversed () const
 Stores the inverse of this matrix in the specified matrix. More...
 
var getInversed ()
 Stores the inverse of this matrix in the specified matrix. More...
 
local getInversed ()
 Stores the inverse of this matrix in the specified matrix. More...
 
bool isIdentity () const
 Determines if this matrix is equal to the identity matrix. More...
 
void multiply (float scalar)
 Multiplies the components of this matrix by the specified scalar. More...
 
void multiply (float scalar, Mat4 *dst) const
 Multiplies the components of this matrix by a scalar and stores the result in dst. More...
 
var multiply ( var scalar, var dst)
 Multiplies the components of this matrix by a scalar and stores the result in dst. More...
 
local multiply ( local scalar, local dst)
 Multiplies the components of this matrix by a scalar and stores the result in dst. More...
 
void multiply (const Mat4 &mat)
 Multiplies this matrix by the specified one. More...
 
var multiply ( var mat)
 Multiplies this matrix by the specified one. More...
 
local multiply ( local mat)
 Multiplies this matrix by the specified one. More...
 
void negate ()
 Negates this matrix. More...
 
var negate ()
 Negates this matrix. More...
 
local negate ()
 Negates this matrix. More...
 
Mat4 getNegated () const
 Negates this matrix and stores the result in dst. More...
 
var getNegated ()
 Negates this matrix and stores the result in dst. More...
 
local getNegated ()
 Negates this matrix and stores the result in dst. More...
 
void rotate (const Quaternion &q)
 Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation. More...
 
var rotate ( var q)
 Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation. More...
 
local rotate ( local q)
 Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation. More...
 
void rotate (const Quaternion &q, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation and stores the result in dst. More...
 
void rotate (const Vec3 &axis, float angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis. More...
 
void rotate (const Vec3 &axis, float angle, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis and stores the result in dst. More...
 
void rotateX (float angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis. More...
 
void rotateX (float angle, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis and stores the result in dst. More...
 
void rotateY (float angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis. More...
 
var rotateY ( var angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis. More...
 
local rotateY ( local angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis. More...
 
void rotateY (float angle, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis and stores the result in dst. More...
 
void rotateZ (float angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis. More...
 
var rotateZ ( var angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis. More...
 
local rotateZ ( local angle)
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis. More...
 
void rotateZ (float angle, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis and stores the result in dst. More...
 
void scale (float value)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
var scale ( var value)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
local scale ( local value)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
void scale (float value, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst. More...
 
void scale (float xScale, float yScale, float zScale)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
var scale ( var xScale, var yScale, var zScale)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
local scale ( local xScale, local yScale, local zScale)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
void scale (float xScale, float yScale, float zScale, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst. More...
 
void scale (const Vec3 &s)
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation. More...
 
void scale (const Vec3 &s, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst. More...
 
void set (float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)
 Sets the values of this matrix. More...
 
void set (const float *mat)
 Sets the values of this matrix to those in the specified column-major array. More...
 
void set (const Mat4 &mat)
 Sets the values of this matrix to those of the specified matrix. More...
 
void setIdentity ()
 Sets this matrix to the identity matrix. More...
 
void setZero ()
 Sets all elements of the current matrix to zero. More...
 
var setZero ()
 Sets all elements of the current matrix to zero. More...
 
local setZero ()
 Sets all elements of the current matrix to zero. More...
 
void subtract (const Mat4 &mat)
 Subtracts the specified matrix from the current matrix. More...
 
var subtract ( var mat)
 Subtracts the specified matrix from the current matrix. More...
 
local subtract ( local mat)
 Subtracts the specified matrix from the current matrix. More...
 
void transformPoint (Vec3 *point) const
 Transforms the specified point by this matrix. More...
 
var transformPoint ( var point)
 Transforms the specified point by this matrix. More...
 
local transformPoint ( local point)
 Transforms the specified point by this matrix. More...
 
void transformPoint (const Vec3 &point, Vec3 *dst) const
 Transforms the specified point by this matrix, and stores the result in dst. More...
 
void transformVector (Vec3 *vector) const
 Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero. More...
 
var transformVector ( var vector)
 Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero. More...
 
local transformVector ( local vector)
 Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero. More...
 
void transformVector (const Vec3 &vector, Vec3 *dst) const
 Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero, and stores the result in dst. More...
 
void transformVector (float x, float y, float z, float w, Vec3 *dst) const
 Transforms the specified vector by this matrix. More...
 
var transformVector ( var x, var y, var z, var w, var dst)
 Transforms the specified vector by this matrix. More...
 
local transformVector ( local x, local y, local z, local w, local dst)
 Transforms the specified vector by this matrix. More...
 
void transformVector (Vec4 *vector) const
 Transforms the specified vector by this matrix. More...
 
var transformVector ( var vector)
 Transforms the specified vector by this matrix. More...
 
local transformVector ( local vector)
 Transforms the specified vector by this matrix. More...
 
void transformVector (const Vec4 &vector, Vec4 *dst) const
 Transforms the specified vector by this matrix. More...
 
var transformVector ( var vector, var dst)
 Transforms the specified vector by this matrix. More...
 
void translate (float x, float y, float z)
 Post-multiplies this matrix by the matrix corresponding to the specified translation. More...
 
void translate (float x, float y, float z, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst. More...
 
void translate (const Vec3 &t)
 Post-multiplies this matrix by the matrix corresponding to the specified translation. More...
 
void translate (const Vec3 &t, Mat4 *dst) const
 Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst. More...
 
void transpose ()
 Transposes this matrix. More...
 
Mat4 getTransposed () const
 Transposes this matrix and stores the result in dst. More...
 
var getTransposed ()
 Transposes this matrix and stores the result in dst. More...
 
local getTransposed ()
 Transposes this matrix and stores the result in dst. More...
 
const Mat4 operator+ (const Mat4 &mat) const
 Calculates the sum of this matrix with the given matrix. More...
 
local operator+ ( local mat)
 Calculates the sum of this matrix with the given matrix. More...
 
Mat4operator+= (const Mat4 &mat)
 Adds the given matrix to this matrix. More...
 
const Mat4 operator- (const Mat4 &mat) const
 Calculates the difference of this matrix with the given matrix. More...
 
Mat4operator-= (const Mat4 &mat)
 Subtracts the given matrix from this matrix. More...
 
const Mat4 operator- () const
 Calculates the negation of this matrix. More...
 
const Mat4 operator* (const Mat4 &mat) const
 Calculates the matrix product of this matrix with the given matrix. More...
 
local operator* ( local mat)
 Calculates the matrix product of this matrix with the given matrix. More...
 
Mat4operator*= (const Mat4 &mat)
 Right-multiplies this matrix by the given matrix. More...
 

Static Public Member Functions

static void createLookAt (const Vec3 &eyePosition, const Vec3 &targetPosition, const Vec3 &up, Mat4 *dst)
 Creates a view matrix based on the specified input parameters. More...
 
local createLookAt ( local eyePosition, local targetPosition, local up, local dst)
 Creates a view matrix based on the specified input parameters. More...
 
static void createLookAt (float eyePositionX, float eyePositionY, float eyePositionZ, float targetCenterX, float targetCenterY, float targetCenterZ, float upX, float upY, float upZ, Mat4 *dst)
 Creates a view matrix based on the specified input parameters. More...
 
local createLookAt ( local eyePositionX, local eyePositionY, local eyePositionZ, local targetCenterX, local targetCenterY, local targetCenterZ, local upX, local upY, local upZ, local dst)
 Creates a view matrix based on the specified input parameters. More...
 
static void createPerspective (float fieldOfView, float aspectRatio, float zNearPlane, float zFarPlane, Mat4 *dst)
 Builds a perspective projection matrix based on a field of view and returns by value. More...
 
local createPerspective ( local fieldOfView, local aspectRatio, local zNearPlane, local zFarPlane, local dst)
 Builds a perspective projection matrix based on a field of view and returns by value. More...
 
static void createOrthographic (float width, float height, float zNearPlane, float zFarPlane, Mat4 *dst)
 Creates an orthographic projection matrix. More...
 
local createOrthographic ( local width, local height, local zNearPlane, local zFarPlane, local dst)
 Creates an orthographic projection matrix. More...
 
static void createOrthographicOffCenter (float left, float right, float bottom, float top, float zNearPlane, float zFarPlane, Mat4 *dst)
 Creates an orthographic projection matrix. More...
 
local createOrthographicOffCenter ( local left, local right, local bottom, local top, local zNearPlane, local zFarPlane, local dst)
 Creates an orthographic projection matrix. More...
 
static void createBillboard (const Vec3 &objectPosition, const Vec3 &cameraPosition, const Vec3 &cameraUpVector, Mat4 *dst)
 Creates a spherical billboard that rotates around a specified object position. More...
 
static void createBillboard (const Vec3 &objectPosition, const Vec3 &cameraPosition, const Vec3 &cameraUpVector, const Vec3 &cameraForwardVector, Mat4 *dst)
 Creates a spherical billboard that rotates around a specified object position with provision for a safe default orientation. More...
 
local createBillboard ( local objectPosition, local cameraPosition, local cameraUpVector, local cameraForwardVector, local dst)
 Creates a spherical billboard that rotates around a specified object position with provision for a safe default orientation. More...
 
static void createScale (const Vec3 &scale, Mat4 *dst)
 Fills in an existing Mat4 so that it reflects the coordinate system about a specified Plane. More...
 
static void createScale (float xScale, float yScale, float zScale, Mat4 *dst)
 Creates a scale matrix. More...
 
local createScale ( local xScale, local yScale, local zScale, local dst)
 Creates a scale matrix. More...
 
static void createRotation (const Quaternion &quat, Mat4 *dst)
 Creates a rotation matrix from the specified quaternion. More...
 
var createRotation ( var quat, var dst)
 Creates a rotation matrix from the specified quaternion. More...
 
local createRotation ( local quat, local dst)
 Creates a rotation matrix from the specified quaternion. More...
 
static void createRotation (const Vec3 &axis, float angle, Mat4 *dst)
 Creates a rotation matrix from the specified axis and angle. More...
 
var createRotation ( var axis, var angle, var dst)
 Creates a rotation matrix from the specified axis and angle. More...
 
local createRotation ( local axis, local angle, local dst)
 Creates a rotation matrix from the specified axis and angle. More...
 
static void createRotationX (float angle, Mat4 *dst)
 Creates a matrix describing a rotation around the x-axis. More...
 
static void createRotationY (float angle, Mat4 *dst)
 Creates a matrix describing a rotation around the y-axis. More...
 
static void createRotationZ (float angle, Mat4 *dst)
 Creates a matrix describing a rotation around the z-axis. More...
 
static void createTranslation (const Vec3 &translation, Mat4 *dst)
 Creates a translation matrix. More...
 
static void createTranslation (float xTranslation, float yTranslation, float zTranslation, Mat4 *dst)
 Creates a translation matrix. More...
 
local createTranslation ( local xTranslation, local yTranslation, local zTranslation, local dst)
 Creates a translation matrix. More...
 
static void add (const Mat4 &m1, const Mat4 &m2, Mat4 *dst)
 Adds the specified matrices and stores the result in dst. More...
 
local add ( local m1, local m2, local dst)
 Adds the specified matrices and stores the result in dst. More...
 
static void multiply (const Mat4 &mat, float scalar, Mat4 *dst)
 Multiplies the components of the specified matrix by a scalar and stores the result in dst. More...
 
local multiply ( local mat, local scalar, local dst)
 Multiplies the components of the specified matrix by a scalar and stores the result in dst. More...
 
static void multiply (const Mat4 &m1, const Mat4 &m2, Mat4 *dst)
 Multiplies m1 by m2 and stores the result in dst. More...
 
local multiply ( local m1, local m2, local dst)
 Multiplies m1 by m2 and stores the result in dst. More...
 
static void subtract (const Mat4 &m1, const Mat4 &m2, Mat4 *dst)
 Subtracts the specified matrix from the current matrix. More...
 
local subtract ( local m1, local m2, local dst)
 Subtracts the specified matrix from the current matrix. More...
 

Public Attributes

float m [16]
 Stores the columns of this 4x4 matrix. More...
 

Static Public Attributes

static const Mat4 ZERO
 equals to a matrix full of zeros More...
 
static const Mat4 IDENTITY
 equals to the identity matrix More...
 

Detailed Description

Copyright 2013 BlackBerry Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Original file from GamePlay3D: http://gameplay3d.org

This file was modified to fit the cocos2d-x project Defines a 4 x 4 floating point matrix representing a 3D transformation.

Vectors are treated as columns, resulting in a matrix that is represented as follows, where x, y and z are the translation components of the matrix:

1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1

This matrix class is directly compatible with OpenGL since its elements are laid out in memory exactly as they are expected by OpenGL. The matrix uses column-major format such that array indices increase down column first. Since matrix multiplication is not commutative, multiplication must be done in the correct order when combining transformations. Suppose we have a translation matrix T and a rotation matrix R. To first rotate an object around the origin and then translate it, you would multiply the two matrices as TR.

Likewise, to first translate the object and then rotate it, you would do RT. So generally, matrices must be multiplied in the reverse order in which you want the transformations to take place (this also applies to the scale, rotate, and translate methods below; these methods are convenience methods for post-multiplying by a matrix representing a scale, rotation, or translation).

In the case of repeated local transformations (i.e. rotate around the Z-axis by 0.76 radians, then translate by 2.1 along the X-axis, then ...), it is better to use the Transform class (which is optimized for that kind of usage).

See also
Transform

Constructor & Destructor Documentation

Mat4 ( )

Constructs a matrix initialized to the identity matrix:

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

var Mat4 ( )

Constructs a matrix initialized to the identity matrix:

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

local Mat4 ( )

Constructs a matrix initialized to the identity matrix:

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

Mat4 ( float  m11,
float  m12,
float  m13,
float  m14,
float  m21,
float  m22,
float  m23,
float  m24,
float  m31,
float  m32,
float  m33,
float  m34,
float  m41,
float  m42,
float  m43,
float  m44 
)

Constructs a matrix initialized to the specified value.

Parameters
m11The first element of the first row.
m12The second element of the first row.
m13The third element of the first row.
m14The fourth element of the first row.
m21The first element of the second row.
m22The second element of the second row.
m23The third element of the second row.
m24The fourth element of the second row.
m31The first element of the third row.
m32The second element of the third row.
m33The third element of the third row.
m34The fourth element of the third row.
m41The first element of the fourth row.
m42The second element of the fourth row.
m43The third element of the fourth row.
m44The fourth element of the fourth row.
var Mat4 ( var  m11,
var  m12,
var  m13,
var  m14,
var  m21,
var  m22,
var  m23,
var  m24,
var  m31,
var  m32,
var  m33,
var  m34,
var  m41,
var  m42,
var  m43,
var  m44 
)

Constructs a matrix initialized to the specified value.

Parameters
m11The first element of the first row.
m12The second element of the first row.
m13The third element of the first row.
m14The fourth element of the first row.
m21The first element of the second row.
m22The second element of the second row.
m23The third element of the second row.
m24The fourth element of the second row.
m31The first element of the third row.
m32The second element of the third row.
m33The third element of the third row.
m34The fourth element of the third row.
m41The first element of the fourth row.
m42The second element of the fourth row.
m43The third element of the fourth row.
m44The fourth element of the fourth row.
local Mat4 ( local  m11,
local  m12,
local  m13,
local  m14,
local  m21,
local  m22,
local  m23,
local  m24,
local  m31,
local  m32,
local  m33,
local  m34,
local  m41,
local  m42,
local  m43,
local  m44 
)

Constructs a matrix initialized to the specified value.

Parameters
m11The first element of the first row.
m12The second element of the first row.
m13The third element of the first row.
m14The fourth element of the first row.
m21The first element of the second row.
m22The second element of the second row.
m23The third element of the second row.
m24The fourth element of the second row.
m31The first element of the third row.
m32The second element of the third row.
m33The third element of the third row.
m34The fourth element of the third row.
m41The first element of the fourth row.
m42The second element of the fourth row.
m43The third element of the fourth row.
m44The fourth element of the fourth row.
Mat4 ( const float *  mat)

Creates a matrix initialized to the specified column-major array.

The passed-in array is in column-major order, so the memory layout of the array is as follows:

0   4   8   12
1   5   9   13
2   6   10  14
3   7   11  15
Parameters
matAn array containing 16 elements in column-major order.
var Mat4 ( var  mat)

Creates a matrix initialized to the specified column-major array.

The passed-in array is in column-major order, so the memory layout of the array is as follows:

0   4   8   12
1   5   9   13
2   6   10  14
3   7   11  15
Parameters
matAn array containing 16 elements in column-major order.
local Mat4 ( local  mat)

Creates a matrix initialized to the specified column-major array.

The passed-in array is in column-major order, so the memory layout of the array is as follows:

0   4   8   12
1   5   9   13
2   6   10  14
3   7   11  15
Parameters
matAn array containing 16 elements in column-major order.
Mat4 ( const Mat4 copy)

Constructs a new matrix by copying the values from the specified matrix.

Parameters
copyThe matrix to copy.
var Mat4 ( var  copy)

Constructs a new matrix by copying the values from the specified matrix.

Parameters
copyThe matrix to copy.
local Mat4 ( local  copy)

Constructs a new matrix by copying the values from the specified matrix.

Parameters
copyThe matrix to copy.
~Mat4 ( )

Destructor.

var ~Mat4 ( )

Destructor.

local ~Mat4 ( )

Destructor.

Member Function Documentation

void add ( float  scalar)

Adds a scalar value to each component of this matrix.

Parameters
scalarThe scalar to add.
var add ( var  scalar)

Adds a scalar value to each component of this matrix.

Parameters
scalarThe scalar to add.
local add ( local  scalar)

Adds a scalar value to each component of this matrix.

Parameters
scalarThe scalar to add.
void add ( float  scalar,
Mat4 dst 
)

Adds a scalar value to each component of this matrix and stores the result in dst.

Parameters
scalarThe scalar value to add.
dstA matrix to store the result in.
var add ( var  scalar,
var  dst 
)

Adds a scalar value to each component of this matrix and stores the result in dst.

Parameters
scalarThe scalar value to add.
dstA matrix to store the result in.
local add ( local  scalar,
local  dst 
)

Adds a scalar value to each component of this matrix and stores the result in dst.

Parameters
scalarThe scalar value to add.
dstA matrix to store the result in.
void add ( const Mat4 mat)

Adds the specified matrix to this matrix.

Parameters
matThe matrix to add.
var add ( var  mat)

Adds the specified matrix to this matrix.

Parameters
matThe matrix to add.
local add ( local  mat)

Adds the specified matrix to this matrix.

Parameters
matThe matrix to add.
static void add ( const Mat4 m1,
const Mat4 m2,
Mat4 dst 
)
static

Adds the specified matrices and stores the result in dst.

Parameters
m1The first matrix.
m2The second matrix.
dstThe destination matrix to add to.
var add ( var  m1,
var  m2,
var  dst 
)
static

Adds the specified matrices and stores the result in dst.

Parameters
m1The first matrix.
m2The second matrix.
dstThe destination matrix to add to.
local add ( local  m1,
local  m2,
local  dst 
)
static

Adds the specified matrices and stores the result in dst.

Parameters
m1The first matrix.
m2The second matrix.
dstThe destination matrix to add to.
static void createBillboard ( const Vec3 objectPosition,
const Vec3 cameraPosition,
const Vec3 cameraUpVector,
Mat4 dst 
)
static

Creates a spherical billboard that rotates around a specified object position.

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, this method defaults to the identity rotation if the positions are too close. (See the other overload of createBillboard for an alternative approach).

Parameters
objectPositionThe position of the object the billboard will rotate around.
cameraPositionThe position of the camera.
cameraUpVectorThe up vector of the camera.
dstA matrix to store the result in.
var createBillboard ( var  objectPosition,
var  cameraPosition,
var  cameraUpVector,
var  dst 
)
static

Creates a spherical billboard that rotates around a specified object position.

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, this method defaults to the identity rotation if the positions are too close. (See the other overload of createBillboard for an alternative approach).

Parameters
objectPositionThe position of the object the billboard will rotate around.
cameraPositionThe position of the camera.
cameraUpVectorThe up vector of the camera.
dstA matrix to store the result in.
local createBillboard ( local  objectPosition,
local  cameraPosition,
local  cameraUpVector,
local  dst 
)
static

Creates a spherical billboard that rotates around a specified object position.

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, this method defaults to the identity rotation if the positions are too close. (See the other overload of createBillboard for an alternative approach).

Parameters
objectPositionThe position of the object the billboard will rotate around.
cameraPositionThe position of the camera.
cameraUpVectorThe up vector of the camera.
dstA matrix to store the result in.
static void createBillboard ( const Vec3 objectPosition,
const Vec3 cameraPosition,
const Vec3 cameraUpVector,
const Vec3 cameraForwardVector,
Mat4 dst 
)
static

Creates a spherical billboard that rotates around a specified object position with provision for a safe default orientation.

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, this method uses the specified camera forward vector if the positions are too close. (See the other overload of createBillboard for an alternative approach).

Parameters
objectPositionThe position of the object the billboard will rotate around.
cameraPositionThe position of the camera.
cameraUpVectorThe up vector of the camera.
cameraForwardVectorThe forward vector of the camera, used if the positions are too close.
dstA matrix to store the result in.
var createBillboard ( var  objectPosition,
var  cameraPosition,
var  cameraUpVector,
var  cameraForwardVector,
var  dst 
)
static

Creates a spherical billboard that rotates around a specified object position with provision for a safe default orientation.

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, this method uses the specified camera forward vector if the positions are too close. (See the other overload of createBillboard for an alternative approach).

Parameters
objectPositionThe position of the object the billboard will rotate around.
cameraPositionThe position of the camera.
cameraUpVectorThe up vector of the camera.
cameraForwardVectorThe forward vector of the camera, used if the positions are too close.
dstA matrix to store the result in.
local createBillboard ( local  objectPosition,
local  cameraPosition,
local  cameraUpVector,
local  cameraForwardVector,
local  dst 
)
static

Creates a spherical billboard that rotates around a specified object position with provision for a safe default orientation.

This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, this method uses the specified camera forward vector if the positions are too close. (See the other overload of createBillboard for an alternative approach).

Parameters
objectPositionThe position of the object the billboard will rotate around.
cameraPositionThe position of the camera.
cameraUpVectorThe up vector of the camera.
cameraForwardVectorThe forward vector of the camera, used if the positions are too close.
dstA matrix to store the result in.
static void createLookAt ( const Vec3 eyePosition,
const Vec3 targetPosition,
const Vec3 up,
Mat4 dst 
)
static

Creates a view matrix based on the specified input parameters.

Parameters
eyePositionThe eye position.
targetPositionThe target's center position.
upThe up vector.
dstA matrix to store the result in.
var createLookAt ( var  eyePosition,
var  targetPosition,
var  up,
var  dst 
)
static

Creates a view matrix based on the specified input parameters.

Parameters
eyePositionThe eye position.
targetPositionThe target's center position.
upThe up vector.
dstA matrix to store the result in.
local createLookAt ( local  eyePosition,
local  targetPosition,
local  up,
local  dst 
)
static

Creates a view matrix based on the specified input parameters.

Parameters
eyePositionThe eye position.
targetPositionThe target's center position.
upThe up vector.
dstA matrix to store the result in.
static void createLookAt ( float  eyePositionX,
float  eyePositionY,
float  eyePositionZ,
float  targetCenterX,
float  targetCenterY,
float  targetCenterZ,
float  upX,
float  upY,
float  upZ,
Mat4 dst 
)
static

Creates a view matrix based on the specified input parameters.

Parameters
eyePositionXThe eye x-coordinate position.
eyePositionYThe eye y-coordinate position.
eyePositionZThe eye z-coordinate position.
targetCenterXThe target's center x-coordinate position.
targetCenterYThe target's center y-coordinate position.
targetCenterZThe target's center z-coordinate position.
upXThe up vector x-coordinate value.
upYThe up vector y-coordinate value.
upZThe up vector z-coordinate value.
dstA matrix to store the result in.
var createLookAt ( var  eyePositionX,
var  eyePositionY,
var  eyePositionZ,
var  targetCenterX,
var  targetCenterY,
var  targetCenterZ,
var  upX,
var  upY,
var  upZ,
var  dst 
)
static

Creates a view matrix based on the specified input parameters.

Parameters
eyePositionXThe eye x-coordinate position.
eyePositionYThe eye y-coordinate position.
eyePositionZThe eye z-coordinate position.
targetCenterXThe target's center x-coordinate position.
targetCenterYThe target's center y-coordinate position.
targetCenterZThe target's center z-coordinate position.
upXThe up vector x-coordinate value.
upYThe up vector y-coordinate value.
upZThe up vector z-coordinate value.
dstA matrix to store the result in.
local createLookAt ( local  eyePositionX,
local  eyePositionY,
local  eyePositionZ,
local  targetCenterX,
local  targetCenterY,
local  targetCenterZ,
local  upX,
local  upY,
local  upZ,
local  dst 
)
static

Creates a view matrix based on the specified input parameters.

Parameters
eyePositionXThe eye x-coordinate position.
eyePositionYThe eye y-coordinate position.
eyePositionZThe eye z-coordinate position.
targetCenterXThe target's center x-coordinate position.
targetCenterYThe target's center y-coordinate position.
targetCenterZThe target's center z-coordinate position.
upXThe up vector x-coordinate value.
upYThe up vector y-coordinate value.
upZThe up vector z-coordinate value.
dstA matrix to store the result in.
static void createOrthographic ( float  width,
float  height,
float  zNearPlane,
float  zFarPlane,
Mat4 dst 
)
static

Creates an orthographic projection matrix.

Parameters
widthThe width of the view.
heightThe height of the view.
zNearPlaneThe minimum z-value of the view volume.
zFarPlaneThe maximum z-value of the view volume.
dstA matrix to store the result in.
var createOrthographic ( var  width,
var  height,
var  zNearPlane,
var  zFarPlane,
var  dst 
)
static

Creates an orthographic projection matrix.

Parameters
widthThe width of the view.
heightThe height of the view.
zNearPlaneThe minimum z-value of the view volume.
zFarPlaneThe maximum z-value of the view volume.
dstA matrix to store the result in.
local createOrthographic ( local  width,
local  height,
local  zNearPlane,
local  zFarPlane,
local  dst 
)
static

Creates an orthographic projection matrix.

Parameters
widthThe width of the view.
heightThe height of the view.
zNearPlaneThe minimum z-value of the view volume.
zFarPlaneThe maximum z-value of the view volume.
dstA matrix to store the result in.
static void
createOrthographicOffCenter
( float  left,
float  right,
float  bottom,
float  top,
float  zNearPlane,
float  zFarPlane,
Mat4 dst 
)
static

Creates an orthographic projection matrix.

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view. To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Parameters
leftThe minimum x-value of the view volume.
rightThe maximum x-value of the view volume.
bottomThe minimum y-value of the view volume.
topThe maximum y-value of the view volume.
zNearPlaneThe minimum z-value of the view volume.
zFarPlaneThe maximum z-value of the view volume.
dstA matrix to store the result in.
var createOrthographicOffCenter ( var  left,
var  right,
var  bottom,
var  top,
var  zNearPlane,
var  zFarPlane,
var  dst 
)
static

Creates an orthographic projection matrix.

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view. To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Parameters
leftThe minimum x-value of the view volume.
rightThe maximum x-value of the view volume.
bottomThe minimum y-value of the view volume.
topThe maximum y-value of the view volume.
zNearPlaneThe minimum z-value of the view volume.
zFarPlaneThe maximum z-value of the view volume.
dstA matrix to store the result in.
local createOrthographicOffCenter ( local  left,
local  right,
local  bottom,
local  top,
local  zNearPlane,
local  zFarPlane,
local  dst 
)
static

Creates an orthographic projection matrix.

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y coordinates ranging from -1 to 1, and z coordinates ranging from 0 to 1.

Unlike perspective projection, in orthographic projection there is no perspective foreshortening.

The viewable area of this orthographic projection extends from left to right on the x-axis, bottom to top on the y-axis, and zNearPlane to zFarPlane on the z-axis. These values are relative to the position and x, y, and z-axes of the view. To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Parameters
leftThe minimum x-value of the view volume.
rightThe maximum x-value of the view volume.
bottomThe minimum y-value of the view volume.
topThe maximum y-value of the view volume.
zNearPlaneThe minimum z-value of the view volume.
zFarPlaneThe maximum z-value of the view volume.
dstA matrix to store the result in.
static void createPerspective ( float  fieldOfView,
float  aspectRatio,
float  zNearPlane,
float  zFarPlane,
Mat4 dst 
)
static

Builds a perspective projection matrix based on a field of view and returns by value.

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from -1 to 1, and a z-coordinate ranging from 0 to 1. To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Parameters
fieldOfViewThe field of view in the y direction (in degrees).
aspectRatioThe aspect ratio, defined as view space width divided by height.
zNearPlaneThe distance to the near view plane.
zFarPlaneThe distance to the far view plane.
dstA matrix to store the result in.
var createPerspective ( var  fieldOfView,
var  aspectRatio,
var  zNearPlane,
var  zFarPlane,
var  dst 
)
static

Builds a perspective projection matrix based on a field of view and returns by value.

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from -1 to 1, and a z-coordinate ranging from 0 to 1. To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Parameters
fieldOfViewThe field of view in the y direction (in degrees).
aspectRatioThe aspect ratio, defined as view space width divided by height.
zNearPlaneThe distance to the near view plane.
zFarPlaneThe distance to the far view plane.
dstA matrix to store the result in.
local createPerspective ( local  fieldOfView,
local  aspectRatio,
local  zNearPlane,
local  zFarPlane,
local  dst 
)
static

Builds a perspective projection matrix based on a field of view and returns by value.

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x- and y-coordinates ranging from -1 to 1, and a z-coordinate ranging from 0 to 1. To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Parameters
fieldOfViewThe field of view in the y direction (in degrees).
aspectRatioThe aspect ratio, defined as view space width divided by height.
zNearPlaneThe distance to the near view plane.
zFarPlaneThe distance to the far view plane.
dstA matrix to store the result in.
static void createRotation ( const Quaternion quat,
Mat4 dst 
)
static

Creates a rotation matrix from the specified quaternion.

Parameters
quatA quaternion describing a 3D orientation.
dstA matrix to store the result in.
var createRotation ( var  quat,
var  dst 
)
static

Creates a rotation matrix from the specified quaternion.

Parameters
quatA quaternion describing a 3D orientation.
dstA matrix to store the result in.
local createRotation ( local  quat,
local  dst 
)
static

Creates a rotation matrix from the specified quaternion.

Parameters
quatA quaternion describing a 3D orientation.
dstA matrix to store the result in.
static void createRotation ( const Vec3 axis,
float  angle,
Mat4 dst 
)
static

Creates a rotation matrix from the specified axis and angle.

Parameters
axisA vector describing the axis to rotate about.
angleThe angle (in radians).
dstA matrix to store the result in.
var createRotation ( var  axis,
var  angle,
var  dst 
)
static

Creates a rotation matrix from the specified axis and angle.

Parameters
axisA vector describing the axis to rotate about.
angleThe angle (in radians).
dstA matrix to store the result in.
local createRotation ( local  axis,
local  angle,
local  dst 
)
static

Creates a rotation matrix from the specified axis and angle.

Parameters
axisA vector describing the axis to rotate about.
angleThe angle (in radians).
dstA matrix to store the result in.
static void createRotationX ( float  angle,
Mat4 dst 
)
static

Creates a matrix describing a rotation around the x-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
var createRotationX ( var  angle,
var  dst 
)
static

Creates a matrix describing a rotation around the x-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
local createRotationX ( local  angle,
local  dst 
)
static

Creates a matrix describing a rotation around the x-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
static void createRotationY ( float  angle,
Mat4 dst 
)
static

Creates a matrix describing a rotation around the y-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
var createRotationY ( var  angle,
var  dst 
)
static

Creates a matrix describing a rotation around the y-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
local createRotationY ( local  angle,
local  dst 
)
static

Creates a matrix describing a rotation around the y-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
static void createRotationZ ( float  angle,
Mat4 dst 
)
static

Creates a matrix describing a rotation around the z-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
var createRotationZ ( var  angle,
var  dst 
)
static

Creates a matrix describing a rotation around the z-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
local createRotationZ ( local  angle,
local  dst 
)
static

Creates a matrix describing a rotation around the z-axis.

Parameters
angleThe angle of rotation (in radians).
dstA matrix to store the result in.
static void createScale ( const Vec3 scale,
Mat4 dst 
)
static

Fills in an existing Mat4 so that it reflects the coordinate system about a specified Plane.

Parameters
planeThe Plane about which to create a reflection.
dstA matrix to store the result in. Creates a scale matrix.
scaleThe amount to scale.
dstA matrix to store the result in.
var createScale ( var  scale,
var  dst 
)
static

Fills in an existing Mat4 so that it reflects the coordinate system about a specified Plane.

Parameters
planeThe Plane about which to create a reflection.
dstA matrix to store the result in. Creates a scale matrix.
scaleThe amount to scale.
dstA matrix to store the result in.
local createScale ( local  scale,
local  dst 
)
static

Fills in an existing Mat4 so that it reflects the coordinate system about a specified Plane.

Parameters
planeThe Plane about which to create a reflection.
dstA matrix to store the result in. Creates a scale matrix.
scaleThe amount to scale.
dstA matrix to store the result in.
static void createScale ( float  xScale,
float  yScale,
float  zScale,
Mat4 dst 
)
static

Creates a scale matrix.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
dstA matrix to store the result in.
var createScale ( var  xScale,
var  yScale,
var  zScale,
var  dst 
)
static

Creates a scale matrix.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
dstA matrix to store the result in.
local createScale ( local  xScale,
local  yScale,
local  zScale,
local  dst 
)
static

Creates a scale matrix.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
dstA matrix to store the result in.
static void createTranslation ( const Vec3 translation,
Mat4 dst 
)
static

Creates a translation matrix.

Parameters
translationThe translation.
dstA matrix to store the result in.
var createTranslation ( var  translation,
var  dst 
)
static

Creates a translation matrix.

Parameters
translationThe translation.
dstA matrix to store the result in.
local createTranslation ( local  translation,
local  dst 
)
static

Creates a translation matrix.

Parameters
translationThe translation.
dstA matrix to store the result in.
static void createTranslation ( float  xTranslation,
float  yTranslation,
float  zTranslation,
Mat4 dst 
)
static

Creates a translation matrix.

Parameters
xTranslationThe translation on the x-axis.
yTranslationThe translation on the y-axis.
zTranslationThe translation on the z-axis.
dstA matrix to store the result in.
var createTranslation ( var  xTranslation,
var  yTranslation,
var  zTranslation,
var  dst 
)
static

Creates a translation matrix.

Parameters
xTranslationThe translation on the x-axis.
yTranslationThe translation on the y-axis.
zTranslationThe translation on the z-axis.
dstA matrix to store the result in.
local createTranslation ( local  xTranslation,
local  yTranslation,
local  zTranslation,
local  dst 
)
static

Creates a translation matrix.

Parameters
xTranslationThe translation on the x-axis.
yTranslationThe translation on the y-axis.
zTranslationThe translation on the z-axis.
dstA matrix to store the result in.
bool decompose ( Vec3 scale,
Quaternion rotation,
Vec3 translation 
) const

Decomposes the scale, rotation and translation components of this matrix.

Parameters
scaleThe scale.
rotationThe rotation.
translationThe translation.
var decompose ( var  scale,
var  rotation,
var  translation 
)

Decomposes the scale, rotation and translation components of this matrix.

Parameters
scaleThe scale.
rotationThe rotation.
translationThe translation.
local decompose ( local  scale,
local  rotation,
local  translation 
)

Decomposes the scale, rotation and translation components of this matrix.

Parameters
scaleThe scale.
rotationThe rotation.
translationThe translation.
float determinant ( ) const

Computes the determinant of this matrix.

Returns
The determinant.
var determinant ( )

Computes the determinant of this matrix.

Returns
The determinant.
local determinant ( )

Computes the determinant of this matrix.

Returns
The determinant.
void getBackVector ( Vec3 dst) const

Gets the backward vector of this matrix.

Parameters
dstThe destination vector.
var getBackVector ( var  dst)

Gets the backward vector of this matrix.

Parameters
dstThe destination vector.
local getBackVector ( local  dst)

Gets the backward vector of this matrix.

Parameters
dstThe destination vector.
void getDownVector ( Vec3 dst) const

Gets the down vector of this matrix.

Parameters
dstThe destination vector.
var getDownVector ( var  dst)

Gets the down vector of this matrix.

Parameters
dstThe destination vector.
local getDownVector ( local  dst)

Gets the down vector of this matrix.

Parameters
dstThe destination vector.
void getForwardVector ( Vec3 dst) const

Gets the forward vector of this matrix.

Parameters
dstThe destination vector.
var getForwardVector ( var  dst)

Gets the forward vector of this matrix.

Parameters
dstThe destination vector.
local getForwardVector ( local  dst)

Gets the forward vector of this matrix.

Parameters
dstThe destination vector.
Mat4 getInversed ( ) const

Stores the inverse of this matrix in the specified matrix.

Parameters
dstA matrix to store the invert of this matrix in.
Returns
true if the the matrix can be inverted, false otherwise.
var getInversed ( )

Stores the inverse of this matrix in the specified matrix.

Parameters
dstA matrix to store the invert of this matrix in.
Returns
true if the the matrix can be inverted, false otherwise.
local getInversed ( )

Stores the inverse of this matrix in the specified matrix.

Parameters
dstA matrix to store the invert of this matrix in.
Returns
true if the the matrix can be inverted, false otherwise.
void getLeftVector ( Vec3 dst) const

Gets the left vector of this matrix.

Parameters
dstThe destination vector.
var getLeftVector ( var  dst)

Gets the left vector of this matrix.

Parameters
dstThe destination vector.
local getLeftVector ( local  dst)

Gets the left vector of this matrix.

Parameters
dstThe destination vector.
Mat4 getNegated ( ) const

Negates this matrix and stores the result in dst.

Parameters
dstA matrix to store the result in.
var getNegated ( )

Negates this matrix and stores the result in dst.

Parameters
dstA matrix to store the result in.
local getNegated ( )

Negates this matrix and stores the result in dst.

Parameters
dstA matrix to store the result in.
void getRightVector ( Vec3 dst) const

Gets the right vector of this matrix.

Parameters
dstThe destination vector.
var getRightVector ( var  dst)

Gets the right vector of this matrix.

Parameters
dstThe destination vector.
local getRightVector ( local  dst)

Gets the right vector of this matrix.

Parameters
dstThe destination vector.
bool getRotation ( Quaternion rotation) const

Gets the rotational component of this matrix in the specified quaternion.

Parameters
rotationA quaternion to receive the rotation.
Returns
true if the rotation is successfully extracted, false otherwise.
var getRotation ( var  rotation)

Gets the rotational component of this matrix in the specified quaternion.

Parameters
rotationA quaternion to receive the rotation.
Returns
true if the rotation is successfully extracted, false otherwise.
local getRotation ( local  rotation)

Gets the rotational component of this matrix in the specified quaternion.

Parameters
rotationA quaternion to receive the rotation.
Returns
true if the rotation is successfully extracted, false otherwise.
void getScale ( Vec3 scale) const

Gets the scalar component of this matrix in the specified vector.

If the scalar component of this matrix has negative parts, it is not possible to always extract the exact scalar component; instead, a scale vector that is mathematically equivalent to the original scale vector is extracted and returned.

Parameters
scaleA vector to receive the scale.
var getScale ( var  scale)

Gets the scalar component of this matrix in the specified vector.

If the scalar component of this matrix has negative parts, it is not possible to always extract the exact scalar component; instead, a scale vector that is mathematically equivalent to the original scale vector is extracted and returned.

Parameters
scaleA vector to receive the scale.
local getScale ( local  scale)

Gets the scalar component of this matrix in the specified vector.

If the scalar component of this matrix has negative parts, it is not possible to always extract the exact scalar component; instead, a scale vector that is mathematically equivalent to the original scale vector is extracted and returned.

Parameters
scaleA vector to receive the scale.
void getTranslation ( Vec3 translation) const

Gets the translational component of this matrix in the specified vector.

Parameters
translationA vector to receive the translation.
var getTranslation ( var  translation)

Gets the translational component of this matrix in the specified vector.

Parameters
translationA vector to receive the translation.
local getTranslation ( local  translation)

Gets the translational component of this matrix in the specified vector.

Parameters
translationA vector to receive the translation.
Mat4 getTransposed ( ) const

Transposes this matrix and stores the result in dst.

Parameters
dstA matrix to store the result in.
var getTransposed ( )

Transposes this matrix and stores the result in dst.

Parameters
dstA matrix to store the result in.
local getTransposed ( )

Transposes this matrix and stores the result in dst.

Parameters
dstA matrix to store the result in.
void getUpVector ( Vec3 dst) const

Gets the up vector of this matrix.

Parameters
dstThe destination vector.
var getUpVector ( var  dst)

Gets the up vector of this matrix.

Parameters
dstThe destination vector.
local getUpVector ( local  dst)

Gets the up vector of this matrix.

Parameters
dstThe destination vector.
bool inverse ( )

Inverts this matrix.

Returns
true if the the matrix can be inverted, false otherwise.
var inverse ( )

Inverts this matrix.

Returns
true if the the matrix can be inverted, false otherwise.
local inverse ( )

Inverts this matrix.

Returns
true if the the matrix can be inverted, false otherwise.
bool isIdentity ( ) const

Determines if this matrix is equal to the identity matrix.

Returns
true if the matrix is an identity matrix, false otherwise.
var isIdentity ( )

Determines if this matrix is equal to the identity matrix.

Returns
true if the matrix is an identity matrix, false otherwise.
local isIdentity ( )

Determines if this matrix is equal to the identity matrix.

Returns
true if the matrix is an identity matrix, false otherwise.
void multiply ( float  scalar)

Multiplies the components of this matrix by the specified scalar.

Parameters
scalarThe scalar value.
var multiply ( var  scalar)

Multiplies the components of this matrix by the specified scalar.

Parameters
scalarThe scalar value.
local multiply ( local  scalar)

Multiplies the components of this matrix by the specified scalar.

Parameters
scalarThe scalar value.
void multiply ( float  scalar,
Mat4 dst 
) const

Multiplies the components of this matrix by a scalar and stores the result in dst.

Parameters
scalarThe scalar value.
dstA matrix to store the result in.
var multiply ( var  scalar,
var  dst 
)

Multiplies the components of this matrix by a scalar and stores the result in dst.

Parameters
scalarThe scalar value.
dstA matrix to store the result in.
local multiply ( local  scalar,
local  dst 
)

Multiplies the components of this matrix by a scalar and stores the result in dst.

Parameters
scalarThe scalar value.
dstA matrix to store the result in.
static void multiply ( const Mat4 mat,
float  scalar,
Mat4 dst 
)
static

Multiplies the components of the specified matrix by a scalar and stores the result in dst.

Parameters
matThe matrix.
scalarThe scalar value.
dstA matrix to store the result in.
var multiply ( var  mat,
var  scalar,
var  dst 
)
static

Multiplies the components of the specified matrix by a scalar and stores the result in dst.

Parameters
matThe matrix.
scalarThe scalar value.
dstA matrix to store the result in.
local multiply ( local  mat,
local  scalar,
local  dst 
)
static

Multiplies the components of the specified matrix by a scalar and stores the result in dst.

Parameters
matThe matrix.
scalarThe scalar value.
dstA matrix to store the result in.
void multiply ( const Mat4 mat)

Multiplies this matrix by the specified one.

Parameters
matThe matrix to multiply.
var multiply ( var  mat)

Multiplies this matrix by the specified one.

Parameters
matThe matrix to multiply.
local multiply ( local  mat)

Multiplies this matrix by the specified one.

Parameters
matThe matrix to multiply.
static void multiply ( const Mat4 m1,
const Mat4 m2,
Mat4 dst 
)
static

Multiplies m1 by m2 and stores the result in dst.

Parameters
m1The first matrix to multiply.
m2The second matrix to multiply.
dstA matrix to store the result in.
var multiply ( var  m1,
var  m2,
var  dst 
)
static

Multiplies m1 by m2 and stores the result in dst.

Parameters
m1The first matrix to multiply.
m2The second matrix to multiply.
dstA matrix to store the result in.
local multiply ( local  m1,
local  m2,
local  dst 
)
static

Multiplies m1 by m2 and stores the result in dst.

Parameters
m1The first matrix to multiply.
m2The second matrix to multiply.
dstA matrix to store the result in.
void negate ( )

Negates this matrix.

var negate ( )

Negates this matrix.

local negate ( )

Negates this matrix.

const Mat4 operator* ( const Mat4 mat) const
inline

Calculates the matrix product of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to multiply by.
Returns
The matrix product.
const Mat4 operator* ( var  mat)
inline

Calculates the matrix product of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to multiply by.
Returns
The matrix product.
const Mat4 operator* ( local  mat)
inline

Calculates the matrix product of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to multiply by.
Returns
The matrix product.
Mat4& operator*= ( const Mat4 mat)
inline

Right-multiplies this matrix by the given matrix.

Parameters
matThe matrix to multiply by.
Returns
This matrix, after the multiplication occurs.
Mat4& operator*= ( var  mat)
inline

Right-multiplies this matrix by the given matrix.

Parameters
matThe matrix to multiply by.
Returns
This matrix, after the multiplication occurs.
Mat4& operator*= ( local  mat)
inline

Right-multiplies this matrix by the given matrix.

Parameters
matThe matrix to multiply by.
Returns
This matrix, after the multiplication occurs.
const Mat4 operator+ ( const Mat4 mat) const
inline

Calculates the sum of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to add.
Returns
The matrix sum.
const Mat4 operator+ ( var  mat)
inline

Calculates the sum of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to add.
Returns
The matrix sum.
const Mat4 operator+ ( local  mat)
inline

Calculates the sum of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to add.
Returns
The matrix sum.
Mat4& operator+= ( const Mat4 mat)
inline

Adds the given matrix to this matrix.

Parameters
matThe matrix to add.
Returns
This matrix, after the addition occurs.
Mat4& operator+= ( var  mat)
inline

Adds the given matrix to this matrix.

Parameters
matThe matrix to add.
Returns
This matrix, after the addition occurs.
Mat4& operator+= ( local  mat)
inline

Adds the given matrix to this matrix.

Parameters
matThe matrix to add.
Returns
This matrix, after the addition occurs.
const Mat4 operator- ( const Mat4 mat) const
inline

Calculates the difference of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to subtract.
Returns
The matrix difference.
const Mat4 operator- ( var  mat)
inline

Calculates the difference of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to subtract.
Returns
The matrix difference.
const Mat4 operator- ( local  mat)
inline

Calculates the difference of this matrix with the given matrix.

Note: this does not modify this matrix.

Parameters
matThe matrix to subtract.
Returns
The matrix difference.
const Mat4 operator- ( ) const
inline

Calculates the negation of this matrix.

Note: this does not modify this matrix.

Returns
The negation of this matrix.
const Mat4 operator- ( )
inline

Calculates the negation of this matrix.

Note: this does not modify this matrix.

Returns
The negation of this matrix.
const Mat4 operator- ( )
inline

Calculates the negation of this matrix.

Note: this does not modify this matrix.

Returns
The negation of this matrix.
Mat4& operator-= ( const Mat4 mat)
inline

Subtracts the given matrix from this matrix.

Parameters
matThe matrix to subtract.
Returns
This matrix, after the subtraction occurs.
Mat4& operator-= ( var  mat)
inline

Subtracts the given matrix from this matrix.

Parameters
matThe matrix to subtract.
Returns
This matrix, after the subtraction occurs.
Mat4& operator-= ( local  mat)
inline

Subtracts the given matrix from this matrix.

Parameters
matThe matrix to subtract.
Returns
This matrix, after the subtraction occurs.
void rotate ( const Quaternion q)

Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation.

Parameters
qThe quaternion to rotate by.
var rotate ( var  q)

Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation.

Parameters
qThe quaternion to rotate by.
local rotate ( local  q)

Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation.

Parameters
qThe quaternion to rotate by.
void rotate ( const Quaternion q,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation and stores the result in dst.

Parameters
qThe quaternion to rotate by.
dstA matrix to store the result in.
var rotate ( var  q,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation and stores the result in dst.

Parameters
qThe quaternion to rotate by.
dstA matrix to store the result in.
local rotate ( local  q,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified quaternion rotation and stores the result in dst.

Parameters
qThe quaternion to rotate by.
dstA matrix to store the result in.
void rotate ( const Vec3 axis,
float  angle 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis.

Parameters
axisThe axis to rotate about.
angleThe angle (in radians).
var rotate ( var  axis,
var  angle 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis.

Parameters
axisThe axis to rotate about.
angleThe angle (in radians).
local rotate ( local  axis,
local  angle 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis.

Parameters
axisThe axis to rotate about.
angleThe angle (in radians).
void rotate ( const Vec3 axis,
float  angle,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis and stores the result in dst.

Parameters
axisThe axis to rotate about.
angleThe angle (in radians).
dstA matrix to store the result in.
var rotate ( var  axis,
var  angle,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis and stores the result in dst.

Parameters
axisThe axis to rotate about.
angleThe angle (in radians).
dstA matrix to store the result in.
local rotate ( local  axis,
local  angle,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation about the specified axis and stores the result in dst.

Parameters
axisThe axis to rotate about.
angleThe angle (in radians).
dstA matrix to store the result in.
void rotateX ( float  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis.

Parameters
angleThe angle (in radians).
var rotateX ( var  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis.

Parameters
angleThe angle (in radians).
local rotateX ( local  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis.

Parameters
angleThe angle (in radians).
void rotateX ( float  angle,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
var rotateX ( var  angle,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
local rotateX ( local  angle,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the x-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
void rotateY ( float  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis.

Parameters
angleThe angle (in radians).
var rotateY ( var  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis.

Parameters
angleThe angle (in radians).
local rotateY ( local  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis.

Parameters
angleThe angle (in radians).
void rotateY ( float  angle,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
var rotateY ( var  angle,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
local rotateY ( local  angle,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the y-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
void rotateZ ( float  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis.

Parameters
angleThe angle (in radians).
var rotateZ ( var  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis.

Parameters
angleThe angle (in radians).
local rotateZ ( local  angle)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis.

Parameters
angleThe angle (in radians).
void rotateZ ( float  angle,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
var rotateZ ( var  angle,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
local rotateZ ( local  angle,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified rotation around the z-axis and stores the result in dst.

Parameters
angleThe angle (in radians).
dstA matrix to store the result in.
void scale ( float  value)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
valueThe amount to scale along all axes.
var scale ( var  value)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
valueThe amount to scale along all axes.
local scale ( local  value)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
valueThe amount to scale along all axes.
void scale ( float  value,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
valueThe amount to scale along all axes.
dstA matrix to store the result in.
var scale ( var  value,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
valueThe amount to scale along all axes.
dstA matrix to store the result in.
local scale ( local  value,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
valueThe amount to scale along all axes.
dstA matrix to store the result in.
void scale ( float  xScale,
float  yScale,
float  zScale 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
var scale ( var  xScale,
var  yScale,
var  zScale 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
local scale ( local  xScale,
local  yScale,
local  zScale 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
void scale ( float  xScale,
float  yScale,
float  zScale,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
dstA matrix to store the result in.
var scale ( var  xScale,
var  yScale,
var  zScale,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
dstA matrix to store the result in.
local scale ( local  xScale,
local  yScale,
local  zScale,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
xScaleThe amount to scale along the x-axis.
yScaleThe amount to scale along the y-axis.
zScaleThe amount to scale along the z-axis.
dstA matrix to store the result in.
void scale ( const Vec3 s)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
sThe scale values along the x, y and z axes.
var scale ( var  s)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
sThe scale values along the x, y and z axes.
local scale ( local  s)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation.

Parameters
sThe scale values along the x, y and z axes.
void scale ( const Vec3 s,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
sThe scale values along the x, y and z axes.
dstA matrix to store the result in.
var scale ( var  s,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
sThe scale values along the x, y and z axes.
dstA matrix to store the result in.
local scale ( local  s,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified scale transformation and stores the result in dst.

Parameters
sThe scale values along the x, y and z axes.
dstA matrix to store the result in.
void set ( float  m11,
float  m12,
float  m13,
float  m14,
float  m21,
float  m22,
float  m23,
float  m24,
float  m31,
float  m32,
float  m33,
float  m34,
float  m41,
float  m42,
float  m43,
float  m44 
)

Sets the values of this matrix.

Parameters
m11The first element of the first row.
m12The second element of the first row.
m13The third element of the first row.
m14The fourth element of the first row.
m21The first element of the second row.
m22The second element of the second row.
m23The third element of the second row.
m24The fourth element of the second row.
m31The first element of the third row.
m32The second element of the third row.
m33The third element of the third row.
m34The fourth element of the third row.
m41The first element of the fourth row.
m42The second element of the fourth row.
m43The third element of the fourth row.
m44The fourth element of the fourth row.
var set ( var  m11,
var  m12,
var  m13,
var  m14,
var  m21,
var  m22,
var  m23,
var  m24,
var  m31,
var  m32,
var  m33,
var  m34,
var  m41,
var  m42,
var  m43,
var  m44 
)

Sets the values of this matrix.

Parameters
m11The first element of the first row.
m12The second element of the first row.
m13The third element of the first row.
m14The fourth element of the first row.
m21The first element of the second row.
m22The second element of the second row.
m23The third element of the second row.
m24The fourth element of the second row.
m31The first element of the third row.
m32The second element of the third row.
m33The third element of the third row.
m34The fourth element of the third row.
m41The first element of the fourth row.
m42The second element of the fourth row.
m43The third element of the fourth row.
m44The fourth element of the fourth row.
local set ( local  m11,
local  m12,
local  m13,
local  m14,
local  m21,
local  m22,
local  m23,
local  m24,
local  m31,
local  m32,
local  m33,
local  m34,
local  m41,
local  m42,
local  m43,
local  m44 
)

Sets the values of this matrix.

Parameters
m11The first element of the first row.
m12The second element of the first row.
m13The third element of the first row.
m14The fourth element of the first row.
m21The first element of the second row.
m22The second element of the second row.
m23The third element of the second row.
m24The fourth element of the second row.
m31The first element of the third row.
m32The second element of the third row.
m33The third element of the third row.
m34The fourth element of the third row.
m41The first element of the fourth row.
m42The second element of the fourth row.
m43The third element of the fourth row.
m44The fourth element of the fourth row.
void set ( const float *  mat)

Sets the values of this matrix to those in the specified column-major array.

Parameters
matAn array containing 16 elements in column-major format.
var set ( var  mat)

Sets the values of this matrix to those in the specified column-major array.

Parameters
matAn array containing 16 elements in column-major format.
local set ( local  mat)

Sets the values of this matrix to those in the specified column-major array.

Parameters
matAn array containing 16 elements in column-major format.
void set ( const Mat4 mat)

Sets the values of this matrix to those of the specified matrix.

Parameters
matThe source matrix.
var set ( var  mat)

Sets the values of this matrix to those of the specified matrix.

Parameters
matThe source matrix.
local set ( local  mat)

Sets the values of this matrix to those of the specified matrix.

Parameters
matThe source matrix.
void setIdentity ( )

Sets this matrix to the identity matrix.

var setIdentity ( )

Sets this matrix to the identity matrix.

local setIdentity ( )

Sets this matrix to the identity matrix.

void setZero ( )

Sets all elements of the current matrix to zero.

var setZero ( )

Sets all elements of the current matrix to zero.

local setZero ( )

Sets all elements of the current matrix to zero.

void subtract ( const Mat4 mat)

Subtracts the specified matrix from the current matrix.

Parameters
matThe matrix to subtract.
var subtract ( var  mat)

Subtracts the specified matrix from the current matrix.

Parameters
matThe matrix to subtract.
local subtract ( local  mat)

Subtracts the specified matrix from the current matrix.

Parameters
matThe matrix to subtract.
static void subtract ( const Mat4 m1,
const Mat4 m2,
Mat4 dst 
)
static

Subtracts the specified matrix from the current matrix.

Parameters
m1The first matrix.
m2The second matrix.
dstA matrix to store the result in.
var subtract ( var  m1,
var  m2,
var  dst 
)
static

Subtracts the specified matrix from the current matrix.

Parameters
m1The first matrix.
m2The second matrix.
dstA matrix to store the result in.
local subtract ( local  m1,
local  m2,
local  dst 
)
static

Subtracts the specified matrix from the current matrix.

Parameters
m1The first matrix.
m2The second matrix.
dstA matrix to store the result in.
void transformPoint ( Vec3 point) const

Transforms the specified point by this matrix.

The result of the transformation is stored directly into point.

Parameters
pointThe point to transform and also a vector to hold the result in.
var transformPoint ( var  point)

Transforms the specified point by this matrix.

The result of the transformation is stored directly into point.

Parameters
pointThe point to transform and also a vector to hold the result in.
local transformPoint ( local  point)

Transforms the specified point by this matrix.

The result of the transformation is stored directly into point.

Parameters
pointThe point to transform and also a vector to hold the result in.
void transformPoint ( const Vec3 point,
Vec3 dst 
) const

Transforms the specified point by this matrix, and stores the result in dst.

Parameters
pointThe point to transform.
dstA vector to store the transformed point in.
var transformPoint ( var  point,
var  dst 
)

Transforms the specified point by this matrix, and stores the result in dst.

Parameters
pointThe point to transform.
dstA vector to store the transformed point in.
local transformPoint ( local  point,
local  dst 
)

Transforms the specified point by this matrix, and stores the result in dst.

Parameters
pointThe point to transform.
dstA vector to store the transformed point in.
void transformVector ( Vec3 vector) const

Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero.

The result of the transformation is stored directly into vector.

Parameters
vectorThe vector to transform and also a vector to hold the result in.
var transformVector ( var  vector)

Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero.

The result of the transformation is stored directly into vector.

Parameters
vectorThe vector to transform and also a vector to hold the result in.
local transformVector ( local  vector)

Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero.

The result of the transformation is stored directly into vector.

Parameters
vectorThe vector to transform and also a vector to hold the result in.
void transformVector ( const Vec3 vector,
Vec3 dst 
) const

Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero, and stores the result in dst.

Parameters
vectorThe vector to transform.
dstA vector to store the transformed vector in.
var transformVector ( var  vector,
var  dst 
)

Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero, and stores the result in dst.

Parameters
vectorThe vector to transform.
dstA vector to store the transformed vector in.
local transformVector ( local  vector,
local  dst 
)

Transforms the specified vector by this matrix by treating the fourth (w) coordinate as zero, and stores the result in dst.

Parameters
vectorThe vector to transform.
dstA vector to store the transformed vector in.
void transformVector ( float  x,
float  y,
float  z,
float  w,
Vec3 dst 
) const

Transforms the specified vector by this matrix.

Parameters
xThe vector x-coordinate to transform by.
yThe vector y-coordinate to transform by.
zThe vector z-coordinate to transform by.
wThe vector w-coordinate to transform by.
dstA vector to store the transformed point in.
var transformVector ( var  x,
var  y,
var  z,
var  w,
var  dst 
)

Transforms the specified vector by this matrix.

Parameters
xThe vector x-coordinate to transform by.
yThe vector y-coordinate to transform by.
zThe vector z-coordinate to transform by.
wThe vector w-coordinate to transform by.
dstA vector to store the transformed point in.
local transformVector ( local  x,
local  y,
local  z,
local  w,
local  dst 
)

Transforms the specified vector by this matrix.

Parameters
xThe vector x-coordinate to transform by.
yThe vector y-coordinate to transform by.
zThe vector z-coordinate to transform by.
wThe vector w-coordinate to transform by.
dstA vector to store the transformed point in.
void transformVector ( Vec4 vector) const

Transforms the specified vector by this matrix.

The result of the transformation is stored directly into vector.

Parameters
vectorThe vector to transform.
var transformVector ( var  vector)

Transforms the specified vector by this matrix.

The result of the transformation is stored directly into vector.

Parameters
vectorThe vector to transform.
local transformVector ( local  vector)

Transforms the specified vector by this matrix.

The result of the transformation is stored directly into vector.

Parameters
vectorThe vector to transform.
void transformVector ( const Vec4 vector,
Vec4 dst 
) const

Transforms the specified vector by this matrix.

Parameters
vectorThe vector to transform.
dstA vector to store the transformed point in.
var transformVector ( var  vector,
var  dst 
)

Transforms the specified vector by this matrix.

Parameters
vectorThe vector to transform.
dstA vector to store the transformed point in.
local transformVector ( local  vector,
local  dst 
)

Transforms the specified vector by this matrix.

Parameters
vectorThe vector to transform.
dstA vector to store the transformed point in.
void translate ( float  x,
float  y,
float  z 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation.

Parameters
xThe amount to translate along the x-axis.
yThe amount to translate along the y-axis.
zThe amount to translate along the z-axis.
var translate ( var  x,
var  y,
var  z 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation.

Parameters
xThe amount to translate along the x-axis.
yThe amount to translate along the y-axis.
zThe amount to translate along the z-axis.
local translate ( local  x,
local  y,
local  z 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation.

Parameters
xThe amount to translate along the x-axis.
yThe amount to translate along the y-axis.
zThe amount to translate along the z-axis.
void translate ( float  x,
float  y,
float  z,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst.

Parameters
xThe amount to translate along the x-axis.
yThe amount to translate along the y-axis.
zThe amount to translate along the z-axis.
dstA matrix to store the result in.
var translate ( var  x,
var  y,
var  z,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst.

Parameters
xThe amount to translate along the x-axis.
yThe amount to translate along the y-axis.
zThe amount to translate along the z-axis.
dstA matrix to store the result in.
local translate ( local  x,
local  y,
local  z,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst.

Parameters
xThe amount to translate along the x-axis.
yThe amount to translate along the y-axis.
zThe amount to translate along the z-axis.
dstA matrix to store the result in.
void translate ( const Vec3 t)

Post-multiplies this matrix by the matrix corresponding to the specified translation.

Parameters
tThe translation values along the x, y and z axes.
var translate ( var  t)

Post-multiplies this matrix by the matrix corresponding to the specified translation.

Parameters
tThe translation values along the x, y and z axes.
local translate ( local  t)

Post-multiplies this matrix by the matrix corresponding to the specified translation.

Parameters
tThe translation values along the x, y and z axes.
void translate ( const Vec3 t,
Mat4 dst 
) const

Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst.

Parameters
tThe translation values along the x, y and z axes.
dstA matrix to store the result in.
var translate ( var  t,
var  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst.

Parameters
tThe translation values along the x, y and z axes.
dstA matrix to store the result in.
local translate ( local  t,
local  dst 
)

Post-multiplies this matrix by the matrix corresponding to the specified translation and stores the result in dst.

Parameters
tThe translation values along the x, y and z axes.
dstA matrix to store the result in.
void transpose ( )

Transposes this matrix.

var transpose ( )

Transposes this matrix.

local transpose ( )

Transposes this matrix.

Member Data Documentation

const Mat4 IDENTITY
static

equals to the identity matrix

float m[16]

Stores the columns of this 4x4 matrix.

float m[16]

Stores the columns of this 4x4 matrix.

float m[16]

Stores the columns of this 4x4 matrix.

const Mat4 ZERO
static

equals to a matrix full of zeros

var ZERO
static

equals to a matrix full of zeros

local ZERO
static

equals to a matrix full of zeros


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