← Standard library

float4x4

struct float4x4

Available without an import.

A column-major matrix with four float4 columns. Supports 3D affine and projection transforms. Rotation APIs accept angle values.

Matrices.wax:173

Members

c0field

public float4 c0

Column 0 in column-major storage.

Matrices.wax:177

c1field

public float4 c1

Column 1 in column-major storage.

Matrices.wax:181

c2field

public float4 c2

Column 2 in column-major storage.

Matrices.wax:185

c3field

public float4 c3

Column 3 in column-major storage.

Matrices.wax:189

constructorconstructor

public constructor (float4 c0, float4 c1, float4 c2, float4 c3)

Stores the supplied columns in order.

Matrices.wax:194

Identitygetter

public static get Identity() : float4x4

The identity transform, with ones on the diagonal and zeros elsewhere.

Matrices.wax:204

From3x3constructor

public constructor From3x3 (float3x3 m)

Embeds the 3-by-3 matrix in a homogeneous 4-by-4 matrix with zero translation and final diagonal entry one.

Matrices.wax:217

transposedgetter

public get transposed() : float4x4

Returns a matrix with rows and columns exchanged.

Matrices.wax:228

determinantgetter

public get determinant() : float

Returns the matrix determinant.

Matrices.wax:240

isIdentitygetter

public get isIdentity() : bool

Tests every component against the identity matrix exactly, with no tolerance.

Matrices.wax:262

Inversemethod

public static fn Inverse(float4x4 mat) : float4x4

Returns the inverse matrix, or an all-zero matrix when the determinant is exactly zero. Near-singular matrices are not rejected.

Matrices.wax:274

Translationmethod

public static fn Translation(float3 t) : float4x4

Creates a homogeneous translation matrix with the displacement in the final column.

Matrices.wax:338

Scalemethod

public static fn Scale(float3 s) : float4x4

Creates a diagonal scale transform with the supplied spatial scale factors.

Matrices.wax:350

RotationXmethod

public static fn RotationX(angle a) : float4x4

Creates a right-handed rotation around the X axis.

Matrices.wax:362

RotationYmethod

public static fn RotationY(angle a) : float4x4

Creates a right-handed rotation around the Y axis.

Matrices.wax:376

RotationZmethod

public static fn RotationZ(angle a) : float4x4

Creates a right-handed rotation around the Z axis.

Matrices.wax:390

RotationAxismethod

public static fn RotationAxis(float3 axis, angle a) : float4x4

Creates a right-handed rotation about a supplied unit axis. Does not normalize the axis.

Matrices.wax:404

LookAtmethod

public static fn LookAt(float3 eye, float3 target, float3 up) : float4x4

Creates a right-handed view matrix looking from eye toward target, with forward along negative view Z. Supply distinct eye/target and an up vector not parallel to the view direction.

Matrices.wax:424

Perspectivemethod

public static fn Perspective(angle fov, float aspect, float near, float far) : float4x4

Creates a right-handed perspective matrix with depth [0, 1]. fov is the vertical field of view and aspect is width/height. Supply 0 < fov < pi, positive aspect, and 0 < near < far.

Matrices.wax:446

Orthomethod

public static fn Ortho(float left, float right, float bottom, float top, float near, float far) : float4x4

Creates a right-handed orthographic matrix with depth [0, 1]. Supply distinct left/right, bottom/top, and near/far bounds.

Matrices.wax:461

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.