Home Reference Source Test
public class | source

Matrix3

Extends:

Matrix → Matrix3

Static Method Summary

Static Public Methods
public static

copy(matrix: Matrix3): *

Makes a copy of the matrix3.

public static

projection(w: number, h: number): *

Static function which returns a projection matrix converting the top left coordinates to 0, 0, and bottom right to w, h.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

m: *

Method Summary

Public Methods
public

add(m3: Matrix3)

Adds a matrix to this matrix.

public

multiply(m3: Matrix3): *

Multiplies a matrix into this matrix.

public

Sets the translation positions of the matrix with x, y points.

public

setRotation(rotationDegree: number)

Sets the matrix rotation values to rotate an object around the z axis.

public

Sets the scale values of the matrix with w, h values.

Inherited Summary

From class Matrix
public

add(m: *)

public

copy()

public

multiply(m: *)

public

setPosition(x: *, y: *)

public

setRotation(rotationDegree: *)

public

setScale(scaleX: *, scaleY: *)

Static Public Methods

public static copy(matrix: Matrix3): * source

Makes a copy of the matrix3. This is a static function and can be called from Matrix3 prototype.

Override:

Matrix#copy

Params:

NameTypeAttributeDescription
matrix Matrix3

The matrix3 to copy.

Return:

*

public static projection(w: number, h: number): * source

Static function which returns a projection matrix converting the top left coordinates to 0, 0, and bottom right to w, h.

(Converted from -1, -1 top left to 1, 1 bottom right.)

Params:

NameTypeAttributeDescription
w number

Width of the projection.

h number

Height of the projection.

Return:

*

Public Constructors

public constructor() source

Public Members

public m: * source

Public Methods

public add(m3: Matrix3) source

Adds a matrix to this matrix.

Override:

Matrix#add

Params:

NameTypeAttributeDescription
m3 Matrix3

The matrix to add to this matrix.

public multiply(m3: Matrix3): * source

Multiplies a matrix into this matrix.

Override:

Matrix#multiply

Params:

NameTypeAttributeDescription
m3 Matrix3

The matrix to multiply to this matrix.

Return:

*

public setPosition(x: number, y: number) source

Sets the translation positions of the matrix with x, y points. This overwrites the values and does not adjust the parameters to work relative to the rest of the matrix values.

Override:

Matrix#setPosition

Params:

NameTypeAttributeDescription
x number

X position.

y number

Y position.

public setRotation(rotationDegree: number) source

Sets the matrix rotation values to rotate an object around the z axis. This overwrites the values and does not adjust the parameters to work relative to the rest of the matrix values.

Override:

Matrix#setRotation

Params:

NameTypeAttributeDescription
rotationDegree number

public setScale(x: number, y: number) source

Sets the scale values of the matrix with w, h values. This overwrites the values and does not adjust the parameters to work relative to the rest of the matrix values.

Override:

Matrix#setScale

Params:

NameTypeAttributeDescription
x number

X scale.

y number

Y scale.