Skip to content

@temporary-escape/mod-sdk / Matrix4f

Class: Matrix4f ​

Defined in: math/matrix4f.ts:7

Constructors ​

Constructor ​

ts
new Matrix4f(): Matrix4f;

Defined in: math/matrix4f.ts:13

Returns ​

Matrix4f

Properties ​

PropertyTypeDefined in
c0Vector4fmath/matrix4f.ts:8
c1Vector4fmath/matrix4f.ts:9
c2Vector4fmath/matrix4f.ts:10
c3Vector4fmath/matrix4f.ts:11

Methods ​

get() ​

ts
get(i: number): Vector4f;

Defined in: math/matrix4f.ts:24

Get a column vector from the matrix.

Parameters ​

ParameterTypeDescription
inumberColumn index in range [0, 3].

Returns ​

Vector4f


set() ​

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

Defined in: math/matrix4f.ts:33

Set a column vector from the matrix.

Parameters ​

ParameterTypeDescription
inumberColumn index in range [0, 3].
vVector4fColumn vector.

Returns ​

void


add() ​

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

Defined in: math/matrix4f.ts:337

Parameters ​

ParameterType
aMatrix4f
bMatrix4f

Returns ​

Matrix4f


determinant() ​

ts
static determinant(m: Matrix4f): number;

Defined in: math/matrix4f.ts:248

Return the determinant of a squared matrix.

Parameters ​

ParameterType
mMatrix4f

Returns ​

number


div() ​

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

Defined in: math/matrix4f.ts:384

Parameters ​

ParameterType
aMatrix4f
bMatrix4f

Returns ​

Matrix4f


equal() ​

ts
static equal(a: Matrix4f, b: Matrix4f): Vector4b;

Defined in: math/matrix4f.ts:398

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
aMatrix4f
bMatrix4f

Returns ​

Vector4b


identity() ​

ts
static identity(): Matrix4f;

Defined in: math/matrix4f.ts:48

Builds an identity matrix.

Returns ​

Matrix4f


inverse() ​

ts
static inverse(m: Matrix4f): Matrix4f;

Defined in: math/matrix4f.ts:127

Returns the inverse of a matrix.

Parameters ​

ParameterType
mMatrix4f

Returns ​

Matrix4f


lookAt() ​

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

Defined in: math/matrix4f.ts:57

Build a look at view matrix based on the default handedness. The engine compiles GLM with GLM_FORCE_LEFT_HANDED, so this matches glm::lookAtLH (which is what glm::lookAt resolves to in the engine).

Parameters ​

ParameterType
eyeVector3f
centerVector3f
upVector3f

Returns ​

Matrix4f


mat3Cast() ​

ts
static mat3Cast(m: Matrix4f): Matrix3f;

Defined in: math/matrix4f.ts:419

Parameters ​

ParameterType
mMatrix4f

Returns ​

Matrix3f


matrixCompMult() ​

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

Defined in: math/matrix4f.ts:285

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
aMatrix4f
bMatrix4f

Returns ​

Matrix4f


mul() ​

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

Defined in: math/matrix4f.ts:355

Parameters ​

ParameterType
aMatrix4f
bMatrix4f

Returns ​

Matrix4f


notEqual() ​

ts
static notEqual(a: Matrix4f, b: Matrix4f): Vector4b;

Defined in: math/matrix4f.ts:410

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

Parameters ​

ParameterType
aMatrix4f
bMatrix4f

Returns ​

Vector4b


outerProduct() ​

ts
static outerProduct(c: Vector4f, r: Vector4f): Matrix4f;

Defined in: math/matrix4f.ts:299

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
cVector4f
rVector4f

Returns ​

Matrix4f


quatCast() ​

ts
static quatCast(m: Matrix4f): Quaternion;

Defined in: math/matrix4f.ts:120

Converts the matrix into a quaternion.

Parameters ​

ParameterType
mMatrix4f

Returns ​

Quaternion


rotate() ​

ts
static rotate(
   m: Matrix4f, 
   angle: number, 
   axis: Vector3f
): Matrix4f;

Defined in: math/matrix4f.ts:77

Builds a rotation 4 * 4 matrix created from an axis vector and an angle.

Parameters ​

ParameterType
mMatrix4f
anglenumber
axisVector3f

Returns ​

Matrix4f


scale() ​

ts
static scale(m: Matrix4f, v: Vector3f): Matrix4f;

Defined in: math/matrix4f.ts:311

Builds a scale 4 * 4 matrix created from 3 scalars.

Parameters ​

ParameterType
mMatrix4f
vVector3f

Returns ​

Matrix4f


sub() ​

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

Defined in: math/matrix4f.ts:346

Parameters ​

ParameterType
aMatrix4f
bMatrix4f

Returns ​

Matrix4f


translate() ​

ts
static translate(m: Matrix4f, v: Vector3f): Matrix4f;

Defined in: math/matrix4f.ts:323

Builds a translation 4 * 4 matrix created from a vector of 3 components.

Parameters ​

ParameterType
mMatrix4f
vVector3f

Returns ​

Matrix4f


transpose() ​

ts
static transpose(m: Matrix4f): Matrix4f;

Defined in: math/matrix4f.ts:236

Returns the transposed matrix of x.

Parameters ​

ParameterType
mMatrix4f

Returns ​

Matrix4f