Drag[en]gine Script Module DragonScript
1.23
|
Immutable 4x4-component row major single precision matrix. More...
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... | |
float | get41 () |
Value at (4,1). More... | |
float | get42 () |
Value at (4,2). More... | |
float | get43 () |
Value at (4,3). More... | |
float | get44 () |
Value at (4,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... | |
Matrix4 | getInverse () |
Inverse. More... | |
Matrix4 | normalize () |
Normalize matrix. More... | |
Quaternion | toQuaternion () |
Quaternion from upper 3x3 matrix. More... | |
DMatrix4 | toDMatrix4 () |
the double precision matrix. More... | |
DMatrix | toDMatrix () |
the double precision matrix. More... | |
Matrix | toMatrix () |
the single precision matrix. More... | |
bool | equals (Object other) |
Matrix4 is equal to another object. More... | |
int | hashCode () |
Hash code for use as dictionary keys. More... | |
String | toString () |
String representation of matrix. More... | |
String | toString (int precision) |
String representation of matrix with precision. More... | |
Operators | |
Matrix4 | operator+ (Matrix4 matrix) |
Sum of matrix with another Matrix4. More... | |
Matrix4 | operator- (Matrix4 matrix) |
Difference of matrix and another Matrix4. More... | |
Matrix4 | operator* (float k) |
Matrix4 multiplied by a factor. More... | |
Matrix4 | operator/ (float k) |
Matrix4 divided by a factor. More... | |
Matrix4 | operator* (Matrix4 matrix) |
Matrix4 multiplied by another Matrix4. More... | |
Vector | operator* (Vector vector) |
Vector transformed by matrix. More... | |
Constructors | |
Matrix4 | new () |
Create identity matrix. More... | |
Matrix4 | 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, float a41, float a42, float a43, float a44) |
Create matrix from values. More... | |
static Matrix4 | newTranslation (Vector translation) |
Create translation matrix. More... | |
static Matrix4 | newTranslation (float tx, float ty, float tz) |
Create translation matrix. More... | |
static Matrix4 | newScaling (Vector scaling) |
Create scaling matrix. More... | |
static Matrix4 | newScaling (float sx, float sy, float sz) |
Create scaling matrix. More... | |
static Matrix4 | newRotationX (float rotation) |
Create rotation around the x axis matrix. More... | |
static Matrix4 | newRotationY (float rotation) |
Create rotation around the y axis matrix. More... | |
static Matrix4 | newRotationZ (float rotation) |
Create rotation around the z axis matrix. More... | |
static Matrix4 | newRotation (Vector rotation) |
Create rotation matrix. More... | |
static Matrix4 | newRotation (float rx, float ry, float rz) |
Create rotation matrix. More... | |
static Matrix4 | 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 Matrix4 | newRT (Vector rotation, Vector translation) |
Create rotation-translation matrix composing of a rotation followed by a translation. More... | |
static Matrix4 | 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 Matrix4 | newVU (Vector view, Vector up) |
Create view-up matrix. More... | |
static Matrix4 | newCamera (Vector position, Vector view, Vector up) |
Create camera matrix. More... | |
static Matrix4 | newWorld (Vector position, Vector view, Vector up) |
Create world matrix. More... | |
static Matrix4 | newWorld (Vector position, Quaternion orientation) |
Create world matrix. More... | |
static Matrix4 | newProjection (int width, int height, float fov, float fovRatio, float znear, float zfar) |
Create projection matrix. More... | |
static Matrix4 | newOrtho (int left, int right, int top, int bottom, int znear, int zfar) |
Create an orthogonal matrix. More... | |
static Matrix4 | 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 Matrix4 | readFromFile (FileReader reader) |
Read matrix from a file reader. More... | |
Immutable 4x4-component row major single precision matrix.
This is a native class. It can not be subclassed.
bool Dragengine.Scenery.Matrix4.equals | ( | Object | other | ) |
float Dragengine.Scenery.Matrix4.get11 | ( | ) |
Value at (1,1).
float Dragengine.Scenery.Matrix4.get12 | ( | ) |
Value at (1,2).
float Dragengine.Scenery.Matrix4.get13 | ( | ) |
Value at (1,3).
float Dragengine.Scenery.Matrix4.get14 | ( | ) |
Value at (1,4).
float Dragengine.Scenery.Matrix4.get21 | ( | ) |
Value at (2,1).
float Dragengine.Scenery.Matrix4.get22 | ( | ) |
Value at (2,2).
float Dragengine.Scenery.Matrix4.get23 | ( | ) |
Value at (2,3).
float Dragengine.Scenery.Matrix4.get24 | ( | ) |
Value at (2,4).
float Dragengine.Scenery.Matrix4.get31 | ( | ) |
Value at (3,1).
float Dragengine.Scenery.Matrix4.get32 | ( | ) |
Value at (3,2).
float Dragengine.Scenery.Matrix4.get33 | ( | ) |
Value at (3,3).
float Dragengine.Scenery.Matrix4.get34 | ( | ) |
Value at (3,4).
float Dragengine.Scenery.Matrix4.get41 | ( | ) |
Value at (4,1).
float Dragengine.Scenery.Matrix4.get42 | ( | ) |
Value at (4,2).
float Dragengine.Scenery.Matrix4.get43 | ( | ) |
Value at (4,3).
float Dragengine.Scenery.Matrix4.get44 | ( | ) |
Value at (4,4).
float Dragengine.Scenery.Matrix4.getAt | ( | int | row, |
int | col | ||
) |
Value at row and colon.
EInvalidParam | row is less than 0 or larger than 3. |
EInvalidParam | col is less than 0 or larger than 3. |
Vector Dragengine.Scenery.Matrix4.getEulerAngles | ( | ) |
Euler angles.
Matrix4 Dragengine.Scenery.Matrix4.getInverse | ( | ) |
Inverse.
int Dragengine.Scenery.Matrix4.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
Matrix4 Dragengine.Scenery.Matrix4.new | ( | ) |
Create identity matrix.
Matrix4 Dragengine.Scenery.Matrix4.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, | ||
float | a41, | ||
float | a42, | ||
float | a43, | ||
float | a44 | ||
) |
Create matrix from values.
|
static |
Create camera matrix.
|
static |
Create rotation matrix from the given quaternion.
|
static |
Create an orthogonal matrix.
|
static |
Create projection matrix.
|
static |
Create rotation matrix.
Create rotation matrix.
|
static |
Create rotation around the x axis matrix.
|
static |
Create rotation around the y axis matrix.
|
static |
Create rotation around the z axis matrix.
Create rotation-translation matrix composing of a rotation followed by a translation.
|
static |
Create scaling matrix.
Create scaling matrix.
|
static |
Create scaling-rotation-translation matrix composing of a scaling followed by a rotation and a translation.
|
static |
Create scale-view-up-translation matrix composing of a rotation followed by a world matrix.
|
static |
Create translation matrix.
Create translation matrix.
Create view-up matrix.
|
static |
Create world matrix.
|
static |
Create world matrix.
Matrix4 Dragengine.Scenery.Matrix4.normalize | ( | ) |
Normalize matrix.
Returns matrix with scaling removed. Only normalized matrices are safe to be used with the getEulerAngles() and toQuaternion() calls since scaling interferes with the calculation.
This calls the same as this code
but is safe against 0-scaling. In such a case a 0-rotation matrix is created.
Difference of matrix and another Matrix4.
Matrix4 Dragengine.Scenery.Matrix4.operator/ | ( | float | k | ) |
Matrix4 divided by a factor.
EDivisionByZero | scalar is 0. |
|
static |
Read matrix from a file reader.
DMatrix Dragengine.Scenery.Matrix4.toDMatrix | ( | ) |
the double precision matrix.
DMatrix4 Dragengine.Scenery.Matrix4.toDMatrix4 | ( | ) |
the double precision matrix.
Matrix Dragengine.Scenery.Matrix4.toMatrix | ( | ) |
the single precision matrix.
Quaternion Dragengine.Scenery.Matrix4.toQuaternion | ( | ) |
Quaternion from upper 3x3 matrix.
String Dragengine.Scenery.Matrix4.toString | ( | ) |
String representation of matrix.
Implements Object.toString()
String Dragengine.Scenery.Matrix4.toString | ( | int | precision | ) |
String representation of matrix with precision.
Same as toString() except the count of digits of each component is precision.
precision | Precision in digits in the range from 0 to 9 inclusive. |
EInvalidParam | precision is less than 0 or larger than 9. |
void Dragengine.Scenery.Matrix4.writeToFile | ( | FileWriter | writer | ) |
Write matrix to a file writer.