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

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

Inheritance diagram for Dragengine.Scenery.TexMatrix2:

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).
bool equals (Object other)
 Texture matrix 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
TexMatrix2 operator+ (TexMatrix2 matrix)
 Sum of matrix with another texture matrix.
TexMatrix2 operator- (TexMatrix2 matrix)
 Difference of matrix and another texture matrix.
TexMatrix2 operator* (float k)
 Texture matrix multiplied by a factor.
TexMatrix2 operator/ (float k)
 Texture matrix divided by a factor.
TexMatrix2 operator* (TexMatrix2 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

TexMatrix2 new ()
 Create identity texture matrix.
TexMatrix2 new (TexMatrix2 matrix)
 Create copy of a texture matrix.
static TexMatrix2 newTranslation (Vector2 translation)
 Create translation texture matrix.
static TexMatrix2 newTranslation (float u, float v)
 Create translation texture matrix.
static TexMatrix2 newScaling (Vector2 scaling)
 Create scaling texture matrix.
static TexMatrix2 newScaling (float u, float v)
 Create scaling texture matrix.
static TexMatrix2 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 TexMatrix2 newST (Vector2 scaling, Vector2 translation)
 Create scaling-translation texture matrix composing of a scaling followed by a translation.
static TexMatrix2 newST (float scalingU, float scalingV, float translationU, float translationV)
 Create scaling-translation texture matrix composing of a scaling followed by a translation.
static TexMatrix2 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 TexMatrix2 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 TexMatrix2 newRT (float rotation, Vector2 translation)
 Create rotation-translation texture matrix composing of a rotation followed by a translation.
static TexMatrix2 newRT (float rotation, float translationU, float translationV)
 Create rotation-translation texture matrix composing of a rotation followed by a translation.
static TexMatrix2 newCenterSRT (Vector2 scaling, float rotation, Vector2 translation)
 Create center scaling-rotation-translation texture matrix.
static TexMatrix2 newCenterSRT (float scalingU, float scalingV, float rotation, float translationU, float translationV)
 Create center scaling-rotation-translation texture matrix.
static TexMatrix2 newCenterRotation (float rotation)
 Create center rotation texture matrix.

File Handling

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

Detailed Description

Immutable 3x2-component row major texture matrix.

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

Member Function Documentation

◆ equals()

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

Texture matrix is equal to another object.

Implements Object.equals(Object).

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

Referenced by operator*().

◆ get11()

float Dragengine.Scenery.TexMatrix2.get11 ( )

Value at (1,1).

Referenced by toString().

◆ get12()

float Dragengine.Scenery.TexMatrix2.get12 ( )

Value at (1,2).

Referenced by toString().

◆ get13()

float Dragengine.Scenery.TexMatrix2.get13 ( )

Value at (1,3).

References newCenterSRT().

Referenced by toString().

◆ get21()

float Dragengine.Scenery.TexMatrix2.get21 ( )

Value at (2,1).

Referenced by toString().

◆ get22()

float Dragengine.Scenery.TexMatrix2.get22 ( )

Value at (2,2).

Referenced by readFromFile().

◆ get23()

float Dragengine.Scenery.TexMatrix2.get23 ( )

Value at (2,3).

References newCenterRotation().

Referenced by writeToFile().

◆ getAt()

float Dragengine.Scenery.TexMatrix2.getAt ( int row,
int col )

Value at row and colon.

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

Referenced by hashCode().

◆ hashCode()

int Dragengine.Scenery.TexMatrix2.hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

References getAt().

Referenced by operator/().

◆ new() [1/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.new ( )

Create identity texture matrix.

References new().

Referenced by new(), and new().

◆ new() [2/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.new ( TexMatrix2 matrix)

Create copy of a texture matrix.

References new().

◆ newCenterRotation()

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

Create center rotation texture matrix.

Version
1.19

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

References newCenterSRT().

Referenced by get23().

◆ newCenterSRT() [1/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.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.

References newRT().

◆ newCenterSRT() [2/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.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.

References newSRT().

Referenced by get13(), and newCenterRotation().

◆ newRotation()

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

Create rotation texture matrix.

References newScaling().

Referenced by newST().

◆ newRT() [1/2]

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

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

Version
1.29

References newSRT(), and newST().

◆ newRT() [2/2]

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

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

Version
1.29

References newST().

Referenced by newCenterSRT().

◆ newScaling() [1/2]

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

Create scaling texture matrix.

◆ newScaling() [2/2]

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

Create scaling texture matrix.

References newTranslation().

Referenced by newRotation(), and newShear().

◆ newShear() [1/2]

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

Create shearing texture matrix.

◆ newShear() [2/2]

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

Create shearing texture matrix.

References newScaling().

Referenced by newSRT(), and newSRT().

◆ newSRT() [1/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.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.

References newShear().

◆ newSRT() [2/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.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.

References newShear().

Referenced by newCenterSRT(), and newRT().

◆ newST() [1/2]

TexMatrix2 Dragengine.Scenery.TexMatrix2.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]

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

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

References newRotation().

Referenced by newRT(), and newRT().

◆ newTranslation() [1/2]

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

Create translation texture matrix.

◆ newTranslation() [2/2]

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

Create translation texture matrix.

References newTranslation().

Referenced by newScaling(), and newTranslation().

◆ operator*() [1/4]

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

Texture matrix multiplied by a factor.

References equals().

◆ operator*() [2/4]

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

Vector transformed by texture matrix.

References readFromFile(), toString(), and writeToFile().

◆ operator*() [3/4]

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

Texture matrix multiplied by another texture matrix.

The textures are added a (0,0,1) row before multiplication. The returned texture matrix composes of the the upper 3x2 part of the multiplied matrix

◆ operator*() [4/4]

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

Vector transformed by texture matrix.

References toString().

◆ operator+()

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

Sum of matrix with another texture matrix.

◆ operator-()

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

Difference of matrix and another texture matrix.

◆ operator/()

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

Texture matrix divided by a factor.

Exceptions
EDivisionByZeroscalar is 0.

References hashCode().

◆ readFromFile()

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

Read texture matrix from a file reader.

References get22().

Referenced by operator*().

◆ toString() [1/2]

String Dragengine.Scenery.TexMatrix2.toString ( )

String representation of texture matrix.

Implements Object.toString()

References get11(), and get12().

Referenced by operator*(), and operator*().

◆ toString() [2/2]

String Dragengine.Scenery.TexMatrix2.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.

References get13(), and get21().

◆ writeToFile()

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

Write texture matrix to a file writer.

References get23().

Referenced by operator*().


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