Table of Contents

Class Mat23

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll

2x3 Matrix

  • A mat2d contains six elements defined as:
  • [a, b,
  • c, d,
  • tx,ty]
  • This is a short form for the 3x3 matrix:
  • [a, b, 0
  • c, d, 0
  • tx,ty,1]
  • The last column is ignored so the array is shorter and operations are faster.
public class Mat23
Inheritance
Mat23
Inherited Members

Methods

CloneIt(float[])

Creates a new mat2d initialized with values from an existing matrix Returns a new 2x3 matrix

public static float[] CloneIt(float[] a)

Parameters

a float[]

matrix to clone

Returns

float[]

Copy(float[], float[])

Copy the values from one mat2d to another Returns output

public static float[] Copy(float[] output, float[] a)

Parameters

output float[]

the receiving matrix

a float[]

the source matrix

Returns

float[]

Create()

Creates a new identity mat2d Returns a new 2x3 matrix

public static float[] Create()

Returns

float[]

Determinant(float[])

Calculates the determinant of a mat2d Returns determinant of a

public static float Determinant(float[] a)

Parameters

a float[]

the source matrix

Returns

float

Identity_(float[])

Set a mat2d to the identity matrix Returns output

public static float[] Identity_(float[] output)

Parameters

output float[]

the receiving matrix

Returns

float[]

Invert(float[], float[])

Inverts a mat2d Returns output

public static float[] Invert(float[] output, float[] a)

Parameters

output float[]

the receiving matrix

a float[]

the source matrix

Returns

float[]

Mul(float[], float[], float[])

Alias for {@link mat2d.multiply} @function

public static float[] Mul(float[] output, float[] a, float[] b)

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Multiply(float[], float[], float[])

Multiplies two mat2d's Returns output

public static float[] Multiply(float[] output, float[] a, float[] b)

Parameters

output float[]

the receiving matrix

a float[]

the first operand

b float[]

the second operand

Returns

float[]

Rotate(float[], float[], float)

Rotates a mat2d by the given angle Returns output

public static float[] Rotate(float[] output, float[] a, float rad)

Parameters

output float[]

the receiving matrix

a float[]

the matrix to rotate

rad float

the angle to rotate the matrix by

Returns

float[]

Scale(float[], float[], float[])

Scales the mat2d by the dimensions in the given vec2 Returns output

public static float[] Scale(float[] output, float[] a, float[] v)

Parameters

output float[]

the receiving matrix

a float[]

the matrix to translate

v float[]

the vec2 to scale the matrix by

Returns

float[]

Translate(float[], float[], float[])

Translates the mat2d by the dimensions in the given vec2 Returns output

public static float[] Translate(float[] output, float[] a, float[] v)

Parameters

output float[]

the receiving matrix

a float[]

the matrix to translate

v float[]

the vec2 to translate the matrix by

Returns

float[]