Skip to content

@temporary-escape/mod-sdk / Matrix3f

Class: Matrix3f ​

Defined in: math/matrix3f.ts:5

Constructors ​

Constructor ​

ts
new Matrix3f(): Matrix3f;

Defined in: math/matrix3f.ts:10

Returns ​

Matrix3f

Properties ​

PropertyTypeDefined in
c0Vector3fmath/matrix3f.ts:6
c1Vector3fmath/matrix3f.ts:7
c2Vector3fmath/matrix3f.ts:8

Methods ​

get() ​

ts
get(i: number): Vector3f;

Defined in: math/matrix3f.ts:20

Get a column vector from the matrix.

Parameters ​

ParameterTypeDescription
inumberColumn index in range [0, 2].

Returns ​

Vector3f


set() ​

ts
set(i: number, v: Vector3f): void;

Defined in: math/matrix3f.ts:29

Set a column vector from the matrix.

Parameters ​

ParameterTypeDescription
inumberColumn index in range [0, 2].
vVector3fColumn vector.

Returns ​

void


add() ​

ts
static add(a: Matrix3f, b: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:198

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Matrix3f


determinant() ​

ts
static determinant(m: Matrix3f): number;

Defined in: math/matrix3f.ts:160

Return the determinant of a squared matrix.

Parameters ​

ParameterType
mMatrix3f

Returns ​

number


div() ​

ts
static div(a: Matrix3f, b: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:254

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Matrix3f


equal() ​

ts
static equal(a: Matrix3f, b: Matrix3f): Vector3b;

Defined in: math/matrix3f.ts:267

Perform a component-wise equal-to comparison of two matrices. Return a boolean vector which components value is True if this expression is satisfied per column of the matrices.

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Vector3b


identity() ​

ts
static identity(): Matrix3f;

Defined in: math/matrix3f.ts:42

Builds an identity matrix.

Returns ​

Matrix3f


inverse() ​

ts
static inverse(m: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:113

Returns the inverse of a matrix.

Parameters ​

ParameterType
mMatrix3f

Returns ​

Matrix3f


lookAt() ​

ts
static lookAt(
   eye: Vector3f, 
   center: Vector3f, 
   up: Vector3f
): Matrix3f;

Defined in: math/matrix3f.ts:52

Build a look at view matrix based on the default handedness. glm::lookAt only produces a 4x4 matrix, so this returns the upper-left 3x3 (rotation) part of the left-handed look at matrix (the engine compiles GLM with GLM_FORCE_LEFT_HANDED).

Parameters ​

ParameterType
eyeVector3f
centerVector3f
upVector3f

Returns ​

Matrix3f


matrixCompMult() ​

ts
static matrixCompMult(a: Matrix3f, b: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:177

Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j].

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Matrix3f


mul() ​

ts
static mul(a: Matrix3f, b: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:214

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Matrix3f


notEqual() ​

ts
static notEqual(a: Matrix3f, b: Matrix3f): Vector3b;

Defined in: math/matrix3f.ts:278

Perform a component-wise not-equal-to comparison of two matrices.

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Vector3b


outerProduct() ​

ts
static outerProduct(c: Vector3f, r: Vector3f): Matrix3f;

Defined in: math/matrix3f.ts:190

Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r.

Parameters ​

ParameterType
cVector3f
rVector3f

Returns ​

Matrix3f


quatCast() ​

ts
static quatCast(m: Matrix3f): Quaternion;

Defined in: math/matrix3f.ts:66

Converts the matrix into a quaternion.

Parameters ​

ParameterType
mMatrix3f

Returns ​

Quaternion


sub() ​

ts
static sub(a: Matrix3f, b: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:206

Parameters ​

ParameterType
aMatrix3f
bMatrix3f

Returns ​

Matrix3f


transpose() ​

ts
static transpose(m: Matrix3f): Matrix3f;

Defined in: math/matrix3f.ts:149

Returns the transposed matrix of x.

Parameters ​

ParameterType
mMatrix3f

Returns ​

Matrix3f