Drag[en]gine Script Module DragonScript Script API  1.0
Matrix Class Reference

Immutable 4x3-component row major matrix. More...

Inheritance diagram for Matrix:

Public Member Functions

Management
float getAt (int row, int col)
 Value at row and colon. More...
 
float get11 ()
 Value at (1,1). More...
 
float get12 ()
 Value at (1,2). More...
 
float get13 ()
 Value at (1,3). More...
 
float get14 ()
 Value at (1,4). More...
 
float get21 ()
 Value at (2,1). More...
 
float get22 ()
 Value at (2,2). More...
 
float get23 ()
 Value at (2,3). More...
 
float get24 ()
 Value at (2,4). More...
 
float get31 ()
 Value at (3,1). More...
 
float get32 ()
 Value at (3,2). More...
 
float get33 ()
 Value at (3,3). More...
 
float get34 ()
 Value at (3,4). More...
 
Vector getViewVector ()
 Vector composed of the third column. More...
 
Vector getUpVector ()
 Vector composed of the second column. More...
 
Vector getRightVector ()
 Vector composed of the first column. More...
 
Vector getPosition ()
 Vector composed of the fourth column. More...
 
Vector transformNormal (Vector normal)
 Transform normal by matrix. More...
 
Vector getEulerAngles ()
 Euler angles. More...
 
Matrix getInverse ()
 Inverse. More...
 
Quaternion toQuaternion ()
 Quaternion from upper 3x3 matrix. More...
 
DMatrix4 toDMatrix4 ()
 the double precision matrix. More...
 
DMatrix toDMatrix ()
 the double precision matrix. More...
 
Matrix4 toMatrix4 ()
 the single precision matrix. More...
 
bool equals (Object other)
 Matrix is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 
String toString ()
 String representation of matrix. More...
 
Operators
Matrix operator+ (Matrix matrix)
 Sum of matrix with another Matrix. More...
 
Matrix operator- (Matrix matrix)
 Difference of matrix and another Matrix. More...
 
Matrix operator* (float k)
 Matrix multiplied by a factor. More...
 
Matrix operator/ (float k)
 Matrix divided by a factor. More...
 
Matrix operator* (Matrix matrix)
 Matrix multiplied by another Matrix. More...
 
Vector operator* (Vector vector)
 Vector transformed by matrix. More...
 

Constructors

Matrix new ()
 Create identity matrix. More...
 
Matrix new (float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34)
 Create matrix from values. More...
 
static Matrix newTranslation (Vector translation)
 Create translation matrix. More...
 
static Matrix newTranslation (float tx, float ty, float tz)
 Create translation matrix. More...
 
static Matrix newScaling (Vector scaling)
 Create scaling matrix. More...
 
static Matrix newScaling (float sx, float sy, float sz)
 Create scaling matrix. More...
 
static Matrix newRotationX (float rotation)
 Create rotation around the x axis matrix. More...
 
static Matrix newRotationY (float rotation)
 Create rotation around the y axis matrix. More...
 
static Matrix newRotationZ (float rotation)
 Create rotation around the z axis matrix. More...
 
static Matrix newRotation (Vector rotation)
 Create rotation matrix. More...
 
static Matrix newRotation (float rx, float ry, float rz)
 Create rotation matrix. More...
 
static Matrix newSRT (Vector scaling, Vector rotation, Vector translation)
 Create scaling-rotation-translation matrix composing of a scaling followed by a rotation and a translation. More...
 
static Matrix newRT (Vector rotation, Vector translation)
 Create rotation-translation matrix composing of a rotation followed by a translation. More...
 
static Matrix newSVUT (Vector scaling, Vector view, Vector up, Vector translation)
 Create scale-view-up-translation matrix composing of a rotation followed by a world matrix. More...
 
static Matrix newVU (Vector view, Vector up)
 Create view-up matrix. More...
 
static Matrix newCamera (Vector position, Vector view, Vector up)
 Create camera matrix. More...
 
static Matrix newWorld (Vector position, Vector view, Vector up)
 Create world matrix. More...
 
static Matrix newWorld (Vector position, Quaternion quaternion)
 Create world matrix. More...
 
static Matrix newFromQuaternion (Quaternion quaternion)
 Create rotation matrix from the given quaternion. More...
 

File Handling

void writeToFile (FileWriter writer)
 Write matrix to a file writer. More...
 
static Matrix readFromFile (FileReader reader)
 Read matrix from a file reader. More...
 

Detailed Description

Immutable 4x3-component row major matrix.

This is a native class. It can not be subclassed.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ equals()

bool equals ( Object  other)

Matrix is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Matrix and components are equal.

§ get11()

float get11 ( )

Value at (1,1).

§ get12()

float get12 ( )

Value at (1,2).

§ get13()

float get13 ( )

Value at (1,3).

§ get14()

float get14 ( )

Value at (1,4).

§ get21()

float get21 ( )

Value at (2,1).

§ get22()

float get22 ( )

Value at (2,2).

§ get23()

float get23 ( )

Value at (2,3).

§ get24()

float get24 ( )

Value at (2,4).

§ get31()

float get31 ( )

Value at (3,1).

§ get32()

float get32 ( )

Value at (3,2).

§ get33()

float get33 ( )

Value at (3,3).

§ get34()

float get34 ( )

Value at (3,4).

§ getAt()

float getAt ( int  row,
int  col 
)

Value at row and colon.

Exceptions
EInvalidParamrow is less than 0 or larger than 2.
EInvalidParamcol is less than 0 or larger than 3.

§ getEulerAngles()

Vector getEulerAngles ( )

Euler angles.

§ getInverse()

Matrix getInverse ( )

Inverse.

§ getPosition()

Vector getPosition ( )

Vector composed of the fourth column.

§ getRightVector()

Vector getRightVector ( )

Vector composed of the first column.

§ getUpVector()

Vector getUpVector ( )

Vector composed of the second column.

§ getViewVector()

Vector getViewVector ( )

Vector composed of the third column.

§ hashCode()

int hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

§ new() [1/2]

Matrix new ( )

Create identity matrix.

§ new() [2/2]

Matrix new ( float  a11,
float  a12,
float  a13,
float  a14,
float  a21,
float  a22,
float  a23,
float  a24,
float  a31,
float  a32,
float  a33,
float  a34 
)

Create matrix from values.

§ newCamera()

static Matrix newCamera ( Vector  position,
Vector  view,
Vector  up 
)
static

Create camera matrix.

§ newFromQuaternion()

static Matrix newFromQuaternion ( Quaternion  quaternion)
static

Create rotation matrix from the given quaternion.

§ newRotation() [1/2]

static Matrix newRotation ( Vector  rotation)
static

Create rotation matrix.

§ newRotation() [2/2]

static Matrix newRotation ( float  rx,
float  ry,
float  rz 
)
static

Create rotation matrix.

§ newRotationX()

static Matrix newRotationX ( float  rotation)
static

Create rotation around the x axis matrix.

§ newRotationY()

static Matrix newRotationY ( float  rotation)
static

Create rotation around the y axis matrix.

§ newRotationZ()

static Matrix newRotationZ ( float  rotation)
static

Create rotation around the z axis matrix.

§ newRT()

static Matrix newRT ( Vector  rotation,
Vector  translation 
)
static

Create rotation-translation matrix composing of a rotation followed by a translation.

§ newScaling() [1/2]

static Matrix newScaling ( Vector  scaling)
static

Create scaling matrix.

§ newScaling() [2/2]

static Matrix newScaling ( float  sx,
float  sy,
float  sz 
)
static

Create scaling matrix.

§ newSRT()

static Matrix newSRT ( Vector  scaling,
Vector  rotation,
Vector  translation 
)
static

Create scaling-rotation-translation matrix composing of a scaling followed by a rotation and a translation.

§ newSVUT()

static Matrix newSVUT ( Vector  scaling,
Vector  view,
Vector  up,
Vector  translation 
)
static

Create scale-view-up-translation matrix composing of a rotation followed by a world matrix.

§ newTranslation() [1/2]

static Matrix newTranslation ( Vector  translation)
static

Create translation matrix.

§ newTranslation() [2/2]

static Matrix newTranslation ( float  tx,
float  ty,
float  tz 
)
static

Create translation matrix.

§ newVU()

static Matrix newVU ( Vector  view,
Vector  up 
)
static

Create view-up matrix.

§ newWorld() [1/2]

static Matrix newWorld ( Vector  position,
Vector  view,
Vector  up 
)
static

Create world matrix.

§ newWorld() [2/2]

static Matrix newWorld ( Vector  position,
Quaternion  quaternion 
)
static

Create world matrix.

§ operator*() [1/3]

Matrix operator* ( float  k)

Matrix multiplied by a factor.

§ operator*() [2/3]

Matrix operator* ( Matrix  matrix)

Matrix multiplied by another Matrix.

§ operator*() [3/3]

Vector operator* ( Vector  vector)

Vector transformed by matrix.

§ operator+()

Matrix operator+ ( Matrix  matrix)

Sum of matrix with another Matrix.

§ operator-()

Matrix operator- ( Matrix  matrix)

Difference of matrix and another Matrix.

§ operator/()

Matrix operator/ ( float  k)

Matrix divided by a factor.

Exceptions
EDivisionByZeroscalar is 0.

§ readFromFile()

static Matrix readFromFile ( FileReader  reader)
static

Read matrix from a file reader.

§ toDMatrix()

DMatrix toDMatrix ( )

the double precision matrix.

§ toDMatrix4()

DMatrix4 toDMatrix4 ( )

the double precision matrix.

§ toMatrix4()

Matrix4 toMatrix4 ( )

the single precision matrix.

§ toQuaternion()

Quaternion toQuaternion ( )

Quaternion from upper 3x3 matrix.

§ toString()

String toString ( )

String representation of matrix.

Implements Object.toString()

§ transformNormal()

Vector transformNormal ( Vector  normal)

Transform normal by matrix.

§ writeToFile()

void writeToFile ( FileWriter  writer)

Write matrix to a file writer.


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