Drag[en]gine Script Module DragonScript 1.32.1
Loading...
Searching...
No Matches
Dragengine.Scenery.TexMatrix Class Reference

Immutable 3x3-component row major texture matrix. More...

Inheritance diagram for Dragengine.Scenery.TexMatrix:

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 get21 ()
 Value at (2,1).
 
float get22 ()
 Value at (2,2).
 
float get23 ()
 Value at (2,3).
 
float get31 ()
 Value at (3,1).
 
float get32 ()
 Value at (3,2).
 
float get33 ()
 Value at (3,3).
 
Vector2 transformNormal (Vector2 normal)
 Transform normal by matrix.
 
Vector2 getPosition ()
 Vector composed of the third column.
 
float getRotationAngle ()
 Rotation angle in degrees.
 
Vector2 getScaling ()
 Scaling.
 
TexMatrix getInverse ()
 Inverse.
 
TexMatrix getRotation ()
 Matrix with only the rotational part.
 
TexMatrix normalize ()
 Normalize matrix.
 
TexMatrix2 toTexMatrix2 ()
 the single precision matrix.
 
bool equals (Object other)
 TexMatrix is equal to another object.
 
int hashCode ()
 Hash code for use as dictionary keys.
 
String toString ()
 String representation of texture matrix.
 
String toString (int precision)
 String representation of texture matrix with precision.
 
Operators
TexMatrix operator+ (TexMatrix matrix)
 Sum of matrix with another texture matrix.
 
TexMatrix operator- (TexMatrix matrix)
 Difference of matrix and another texture matrix.
 
TexMatrix operator* (float k)
 Texture matrix multiplied by a factor.
 
TexMatrix operator/ (float k)
 Texture matrix divided by a factor.
 
TexMatrix operator* (TexMatrix matrix)
 Texture matrix multiplied by another texture matrix.
 
Vector2 operator* (Vector2 texcoord)
 Vector transformed by texture matrix.
 
Vector2 operator* (float u, float v)
 Vector transformed by texture matrix.
 

Constructors

TexMatrix new ()
 Create identity texture matrix.
 
TexMatrix new (TexMatrix matrix)
 Create copy of a texture matrix.
 
static TexMatrix newTranslation (Vector2 translation)
 Create translation texture matrix.
 
static TexMatrix newTranslation (float u, float v)
 Create translation texture matrix.
 
static TexMatrix newScaling (Vector2 scaling)
 Create scaling texture matrix.
 
static TexMatrix newScaling (float u, float v)
 Create scaling texture matrix.
 
static TexMatrix newRotation (float rotation)
 Create rotation texture matrix.
 
static TexMatrix newShear (Vector2 shear)
 Create shearing texture matrix.
 
static TexMatrix newShear (float u, float v)
 Create shearing texture matrix.
 
static TexMatrix newST (Vector2 scaling, Vector2 translation)
 Create scaling-translation texture matrix composing of a scaling followed by a translation.
 
static TexMatrix newST (float scalingU, float scalingV, float translationU, float translationV)
 Create scaling-translation texture matrix composing of a scaling followed by a translation.
 
static TexMatrix newSRT (Vector2 scaling, float rotation, Vector2 translation)
 Create scaling-rotation-translation texture matrix composing of a scaling followed by a rotation and a translation.
 
static TexMatrix newSRT (float scalingU, float scalingV, float rotation, float translationU, float translationV)
 Create scaling-rotation-translation texture matrix composing of a scaling followed by a rotation and a translation.
 
static TexMatrix newRT (float rotation, Vector2 translation)
 Create rotation-translation texture matrix composing of a rotation followed by a translation.
 
static TexMatrix newRT (float rotation, float translationU, float translationV)
 Create rotation-translation texture matrix composing of a rotation followed by a translation.
 
static TexMatrix newCenterSRT (Vector2 scaling, float rotation, Vector2 translation)
 Create center scaling-rotation-translation texture matrix.
 
static TexMatrix newCenterSRT (float scalingU, float scalingV, float rotation, float translationU, float translationV)
 Create center scaling-rotation-translation texture matrix.
 
static TexMatrix newCenterRotation (float rotation)
 Create center rotation texture matrix.
 

File Handling

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

Detailed Description

Immutable 3x3-component row major texture matrix.

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

Member Function Documentation

◆ equals()

bool Dragengine.Scenery.TexMatrix.equals ( Object  other)

TexMatrix is equal to another object.

Implements Object.equals(Object).

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

◆ get11()

float Dragengine.Scenery.TexMatrix.get11 ( )

Value at (1,1).

◆ get12()

float Dragengine.Scenery.TexMatrix.get12 ( )

Value at (1,2).

◆ get13()

float Dragengine.Scenery.TexMatrix.get13 ( )

Value at (1,3).

◆ get21()

float Dragengine.Scenery.TexMatrix.get21 ( )

Value at (2,1).

◆ get22()

float Dragengine.Scenery.TexMatrix.get22 ( )

Value at (2,2).

◆ get23()

float Dragengine.Scenery.TexMatrix.get23 ( )

Value at (2,3).

◆ get31()

float Dragengine.Scenery.TexMatrix.get31 ( )

Value at (3,1).

◆ get32()

float Dragengine.Scenery.TexMatrix.get32 ( )

Value at (3,2).

◆ get33()

float Dragengine.Scenery.TexMatrix.get33 ( )

Value at (3,3).

◆ getAt()

float Dragengine.Scenery.TexMatrix.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 2.

◆ getInverse()

TexMatrix Dragengine.Scenery.TexMatrix.getInverse ( )

Inverse.

Version
1.29

◆ getPosition()

Vector2 Dragengine.Scenery.TexMatrix.getPosition ( )

Vector composed of the third column.

Version
1.29

◆ getRotation()

TexMatrix Dragengine.Scenery.TexMatrix.getRotation ( )

Matrix with only the rotational part.

Version
1.29

◆ getRotationAngle()

float Dragengine.Scenery.TexMatrix.getRotationAngle ( )

Rotation angle in degrees.

Version
1.29

◆ getScaling()

Vector2 Dragengine.Scenery.TexMatrix.getScaling ( )

Scaling.

Version
1.29

◆ hashCode()

int Dragengine.Scenery.TexMatrix.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

◆ new() [1/2]

TexMatrix Dragengine.Scenery.TexMatrix.new ( )

Create identity texture matrix.

◆ new() [2/2]

TexMatrix Dragengine.Scenery.TexMatrix.new ( TexMatrix  matrix)

Create copy of a texture matrix.

◆ newCenterRotation()

static TexMatrix Dragengine.Scenery.TexMatrix.newCenterRotation ( float  rotation)
static

Create center rotation texture matrix.

Version
1.29

Similar to newRotation but the coordinate system is first shifted to the center of the texture (0.5,0.5) before rotation is applied.

◆ newCenterSRT() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newCenterSRT ( float  scalingU,
float  scalingV,
float  rotation,
float  translationU,
float  translationV 
)
static

Create center scaling-rotation-translation texture matrix.

Composing of a scaling followed by a rotation and a translation. Similar to newSRT but the coordinate system is first shifted to the center of the texture (0.5,0.5) before scale-rotate-translation is applied.

◆ newCenterSRT() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newCenterSRT ( Vector2  scaling,
float  rotation,
Vector2  translation 
)
static

Create center scaling-rotation-translation texture matrix.

Composing of a scaling followed by a rotation and a translation. Similar to newSRT but the coordinate system is first shifted to the center of the texture (0.5,0.5) before scale-rotate-translation is applied.

◆ newRotation()

static TexMatrix Dragengine.Scenery.TexMatrix.newRotation ( float  rotation)
static

Create rotation texture matrix.

◆ newRT() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newRT ( float  rotation,
float  translationU,
float  translationV 
)
static

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

Version
1.29

◆ newRT() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newRT ( float  rotation,
Vector2  translation 
)
static

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

Version
1.29

◆ newScaling() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newScaling ( float  u,
float  v 
)
static

Create scaling texture matrix.

◆ newScaling() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newScaling ( Vector2  scaling)
static

Create scaling texture matrix.

◆ newShear() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newShear ( float  u,
float  v 
)
static

Create shearing texture matrix.

Version
1.29

◆ newShear() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newShear ( Vector2  shear)
static

Create shearing texture matrix.

Version
1.29

◆ newSRT() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newSRT ( float  scalingU,
float  scalingV,
float  rotation,
float  translationU,
float  translationV 
)
static

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

◆ newSRT() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newSRT ( Vector2  scaling,
float  rotation,
Vector2  translation 
)
static

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

◆ newST() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newST ( float  scalingU,
float  scalingV,
float  translationU,
float  translationV 
)
static

Create scaling-translation texture matrix composing of a scaling followed by a translation.

◆ newST() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newST ( Vector2  scaling,
Vector2  translation 
)
static

Create scaling-translation texture matrix composing of a scaling followed by a translation.

◆ newTranslation() [1/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newTranslation ( float  u,
float  v 
)
static

Create translation texture matrix.

◆ newTranslation() [2/2]

static TexMatrix Dragengine.Scenery.TexMatrix.newTranslation ( Vector2  translation)
static

Create translation texture matrix.

◆ normalize()

TexMatrix Dragengine.Scenery.TexMatrix.normalize ( )

Normalize matrix.

Version
1.29

Returns matrix with scaling removed. Only normalized matrices are safe to be used with the getRotationAngle() calls since scaling interferes with the calculation.

◆ operator*() [1/4]

TexMatrix Dragengine.Scenery.TexMatrix.operator* ( float  k)

Texture matrix multiplied by a factor.

◆ operator*() [2/4]

Vector2 Dragengine.Scenery.TexMatrix.operator* ( float  u,
float  v 
)

Vector transformed by texture matrix.

◆ operator*() [3/4]

TexMatrix Dragengine.Scenery.TexMatrix.operator* ( TexMatrix  matrix)

Texture matrix multiplied by another texture matrix.

◆ operator*() [4/4]

Vector2 Dragengine.Scenery.TexMatrix.operator* ( Vector2  texcoord)

Vector transformed by texture matrix.

◆ operator+()

TexMatrix Dragengine.Scenery.TexMatrix.operator+ ( TexMatrix  matrix)

Sum of matrix with another texture matrix.

◆ operator-()

TexMatrix Dragengine.Scenery.TexMatrix.operator- ( TexMatrix  matrix)

Difference of matrix and another texture matrix.

◆ operator/()

TexMatrix Dragengine.Scenery.TexMatrix.operator/ ( float  k)

Texture matrix divided by a factor.

Exceptions
EDivisionByZeroscalar is 0.

◆ readFromFile()

static TexMatrix Dragengine.Scenery.TexMatrix.readFromFile ( FileReader  reader)
static

Read texture matrix from a file reader.

◆ toString() [1/2]

String Dragengine.Scenery.TexMatrix.toString ( )

String representation of texture matrix.

Implements Object.toString()

◆ toString() [2/2]

String Dragengine.Scenery.TexMatrix.toString ( int  precision)

String representation of texture matrix with precision.

Same as toString() except the count of digits of each component is precision.

Parameters
precisionPrecision in digits in the range from 0 to 9 inclusive.
Exceptions
EInvalidParamprecision is less than 0 or larger than 9.

◆ toTexMatrix2()

TexMatrix2 Dragengine.Scenery.TexMatrix.toTexMatrix2 ( )

the single precision matrix.

Version
1.29

◆ transformNormal()

Vector2 Dragengine.Scenery.TexMatrix.transformNormal ( Vector2  normal)

Transform normal by matrix.

◆ writeToFile()

void Dragengine.Scenery.TexMatrix.writeToFile ( FileWriter  writer)

Write texture matrix to a file writer.


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