|
Drag[en]gine Script Module DragonScript 1.35
|
Immutable 4x4-component row major double precision matrix. More...
Public Member Functions | |
Management | |
| float | getAt (int row, int col) |
| Value at row and colon. | |
| float | get11 () |
| Value at (1,1). | |
| float | get12 () |
| Value at (1,2). | |
| float | get13 () |
| Value at (1,3). | |
| float | get14 () |
| Value at (1,4). | |
| float | get21 () |
| Value at (2,1). | |
| float | get22 () |
| Value at (2,2). | |
| float | get23 () |
| Value at (2,3). | |
| float | get24 () |
| Value at (2,4). | |
| float | get31 () |
| Value at (3,1). | |
| float | get32 () |
| Value at (3,2). | |
| float | get33 () |
| Value at (3,3). | |
| float | get34 () |
| Value at (3,4). | |
| float | get41 () |
| Value at (4,1). | |
| float | get42 () |
| Value at (4,2). | |
| float | get43 () |
| Value at (4,3). | |
| float | get44 () |
| Value at (4,4). | |
| DVector | getViewVector () |
| Vector composed of the third column. | |
| DVector | getUpVector () |
| Vector composed of the second column. | |
| DVector | getRightVector () |
| Vector composed of the first column. | |
| DVector | getPosition () |
| Vector composed of the fourth column. | |
| DVector | transformNormal (DVector normal) |
| Transform normal by matrix. | |
| DVector | getEulerAngles () |
| Euler angles. | |
| DMatrix4 | getInverse () |
| Inverse. | |
| DMatrix4 | normalize () |
| Normalize matrix. | |
| Quaternion | toQuaternion () |
| Quaternion from upper 3x3 matrix. | |
| DMatrix | toDMatrix () |
| the double precision matrix. | |
| Matrix4 | toMatrix4 () |
| the single precision matrix. | |
| Matrix | toMatrix () |
| the single precision matrix. | |
| bool | equals (Object other) |
| Matrix is equal to another object. | |
| int | hashCode () |
| Hash code for use as dictionary keys. | |
| String | toString () |
| String representation of matrix. | |
| String | toString (int precision) |
| String representation of matrix with precision. | |
Operators | |
| DMatrix4 | operator+ (DMatrix4 matrix) |
| Sum of matrix with another DMatrix4. | |
| DMatrix4 | operator- (DMatrix4 matrix) |
| Difference of matrix and another DMatrix4. | |
| DMatrix4 | operator* (float k) |
| Matrix multiplied by a factor. | |
| DMatrix4 | operator/ (float k) |
| Matrix divided by a factor. | |
| DMatrix4 | operator* (DMatrix4 matrix) |
| Matrix multiplied by another DMatrix4. | |
| DVector | operator* (DVector vector) |
| Vector transformed by matrix. | |
Constructors | |
| DMatrix4 | new () |
| Create identity matrix. | |
| DMatrix4 | 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 DMatrix4 | newTranslation (DVector translation) |
| Create translation matrix. | |
| static DMatrix4 | newTranslation (float tx, float ty, float tz) |
| Create translation matrix. | |
| static DMatrix4 | newScaling (DVector scaling) |
| Create scaling matrix. | |
| static DMatrix4 | newScaling (float sx, float sy, float sz) |
| Create scaling matrix. | |
| static DMatrix4 | newRotationX (float rotation) |
| Create rotation around the x axis matrix. | |
| static DMatrix4 | newRotationY (float rotation) |
| Create rotation around the y axis matrix. | |
| static DMatrix4 | newRotationZ (float rotation) |
| Create rotation around the z axis matrix. | |
| static DMatrix4 | newRotation (DVector rotation) |
| Create rotation matrix. | |
| static DMatrix4 | newRotation (float rx, float ry, float rz) |
| Create rotation matrix. | |
| static DMatrix4 | newSRT (DVector scaling, DVector rotation, DVector translation) |
| Create scaling-rotation-translation matrix composing of a scaling followed by a rotation and a translation. | |
| static DMatrix4 | newRT (DVector rotation, DVector translation) |
| Create rotation-translation matrix composing of a rotation followed by a translation. | |
| static DMatrix4 | newSVUT (DVector scaling, DVector view, DVector up, DVector translation) |
| Create scale-view-up-translation matrix composing of a rotation followed by a world matrix. | |
| static DMatrix4 | newVU (DVector view, DVector up) |
| Create view-up matrix. | |
| static DMatrix4 | newCamera (DVector position, DVector view, DVector up) |
| Create camera matrix. | |
| static DMatrix4 | newWorld (DVector position, DVector view, DVector up) |
| Create world matrix. | |
| static DMatrix4 | newWorld (DVector position, Quaternion orientation) |
| Create world matrix. | |
| static DMatrix4 | newProjection (int width, int height, float fov, float fovRatio, float znear, float zfar) |
| Create projection matrix. | |
| static DMatrix4 | newOrtho (int left, int right, int top, int bottom, int znear, int zfar) |
| Create an orthogonal matrix. | |
| static DMatrix4 | newFromQuaternion (Quaternion quaternion) |
| Create rotation matrix from the given quaternion. | |
File Handling | |
| void | writeToFile (FileWriter writer) |
| Write matrix to a file writer. | |
| static DMatrix4 | readFromFile (FileReader reader) |
| Read matrix from a file reader. | |
Immutable 4x4-component row major double precision matrix.
This is a native class. It can not be subclassed.
| bool Dragengine.Scenery.DMatrix4.equals | ( | Object | other | ) |
Matrix is equal to another object.
Implements Object.equals(Object).
References get42().
Referenced by operator*().
| float Dragengine.Scenery.DMatrix4.get11 | ( | ) |
Value at (1,1).
Referenced by get43().
| float Dragengine.Scenery.DMatrix4.get12 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get13 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get14 | ( | ) |
Value at (1,4).
Referenced by getPosition().
| float Dragengine.Scenery.DMatrix4.get21 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get22 | ( | ) |
Value at (2,2).
Referenced by getInverse().
| float Dragengine.Scenery.DMatrix4.get23 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get24 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get31 | ( | ) |
Value at (3,1).
Referenced by normalize().
| float Dragengine.Scenery.DMatrix4.get32 | ( | ) |
Value at (3,2).
Referenced by toQuaternion().
| float Dragengine.Scenery.DMatrix4.get33 | ( | ) |
Value at (3,3).
Referenced by toMatrix4().
| float Dragengine.Scenery.DMatrix4.get34 | ( | ) |
Value at (3,4).
Referenced by toMatrix().
| float Dragengine.Scenery.DMatrix4.get41 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get42 | ( | ) |
Value at (4,2).
Referenced by equals().
| float Dragengine.Scenery.DMatrix4.get43 | ( | ) |
| float Dragengine.Scenery.DMatrix4.get44 | ( | ) |
| float Dragengine.Scenery.DMatrix4.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. |
References newCamera().
Referenced by get41().
| DVector Dragengine.Scenery.DMatrix4.getEulerAngles | ( | ) |
Euler angles.
Referenced by operator-().
| DMatrix4 Dragengine.Scenery.DMatrix4.getInverse | ( | ) |
| DVector Dragengine.Scenery.DMatrix4.getPosition | ( | ) |
| DVector Dragengine.Scenery.DMatrix4.getRightVector | ( | ) |
Vector composed of the first column.
Referenced by toString().
| DVector Dragengine.Scenery.DMatrix4.getUpVector | ( | ) |
| DVector Dragengine.Scenery.DMatrix4.getViewVector | ( | ) |
Vector composed of the third column.
Referenced by toString().
| int Dragengine.Scenery.DMatrix4.hashCode | ( | ) |
Hash code for use as dictionary keys.
Implements Object.hashCode().
References get43().
Referenced by operator*().
| DMatrix4 Dragengine.Scenery.DMatrix4.new | ( | ) |
| DMatrix4 Dragengine.Scenery.DMatrix4.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.
References new().
|
static |
Create camera matrix.
Referenced by getAt().
|
static |
|
static |
|
static |
Create projection matrix.
Referenced by get21().
|
static |
Create rotation matrix.
|
static |
|
static |
|
static |
Create rotation around the z axis matrix.
Referenced by newRT().
Create rotation-translation matrix composing of a rotation followed by a translation.
References newRotationZ().
Referenced by newOrtho().
Create scaling matrix.
References newTranslation().
Referenced by newRotationX(), and newRotationY().
|
static |
Create scaling matrix.
|
static |
Create scaling-rotation-translation matrix composing of a scaling followed by a rotation and a translation.
References newRotationY().
Referenced by newWorld().
|
static |
Create scale-view-up-translation matrix composing of a rotation followed by a world matrix.
Referenced by newFromQuaternion().
Create translation matrix.
References newTranslation().
Referenced by newScaling(), and newTranslation().
|
static |
Create translation matrix.
|
static |
Create world matrix.
References newSRT().
| DMatrix4 Dragengine.Scenery.DMatrix4.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.
References get31().
Referenced by operator*().
Vector transformed by matrix.
References equals(), hashCode(), normalize(), readFromFile(), toDMatrix(), toMatrix(), toMatrix4(), toQuaternion(), toString(), and writeToFile().
| DMatrix4 Dragengine.Scenery.DMatrix4.operator* | ( | float | k | ) |
Matrix multiplied by a factor.
References getInverse().
Sum of matrix with another DMatrix4.
Difference of matrix and another DMatrix4.
References getEulerAngles().
| DMatrix4 Dragengine.Scenery.DMatrix4.operator/ | ( | float | k | ) |
Matrix divided by a factor.
| EDivisionByZero | scalar is 0. |
|
static |
Read matrix from a file reader.
Referenced by operator*().
| DMatrix Dragengine.Scenery.DMatrix4.toDMatrix | ( | ) |
the double precision matrix.
Referenced by operator*().
| Matrix Dragengine.Scenery.DMatrix4.toMatrix | ( | ) |
| Matrix4 Dragengine.Scenery.DMatrix4.toMatrix4 | ( | ) |
| Quaternion Dragengine.Scenery.DMatrix4.toQuaternion | ( | ) |
| String Dragengine.Scenery.DMatrix4.toString | ( | ) |
String representation of matrix.
Implements Object.toString()
References get44(), and getViewVector().
Referenced by operator*().
| String Dragengine.Scenery.DMatrix4.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 17 inclusive. |
| EInvalidParam | precision is less than 0 or larger than 17. |
References getRightVector(), and getUpVector().
| void Dragengine.Scenery.DMatrix4.writeToFile | ( | FileWriter | writer | ) |
Write matrix to a file writer.
References getPosition(), and transformNormal().
Referenced by operator*().