float4x4
struct float4x4Available without an import.
A column-major matrix with four float4 columns. Supports 3D affine and projection transforms. Rotation APIs accept angle values.
Members
c0field
public float4 c0Column 0 in column-major storage.
c1field
public float4 c1Column 1 in column-major storage.
c2field
public float4 c2Column 2 in column-major storage.
c3field
public float4 c3Column 3 in column-major storage.
constructorconstructor
public constructor (float4 c0, float4 c1, float4 c2, float4 c3)Stores the supplied columns in order.
Identitygetter
public static get Identity() : float4x4The identity transform, with ones on the diagonal and zeros elsewhere.
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.
transposedgetter
public get transposed() : float4x4Returns a matrix with rows and columns exchanged.
determinantgetter
public get determinant() : floatReturns the matrix determinant.
isIdentitygetter
public get isIdentity() : boolTests every component against the identity matrix exactly, with no tolerance.
Inversemethod
public static fn Inverse(float4x4 mat) : float4x4Returns the inverse matrix, or an all-zero matrix when the determinant is exactly zero. Near-singular matrices are not rejected.
Translationmethod
public static fn Translation(float3 t) : float4x4Creates a homogeneous translation matrix with the displacement in the final column.
Scalemethod
public static fn Scale(float3 s) : float4x4Creates a diagonal scale transform with the supplied spatial scale factors.
RotationXmethod
public static fn RotationX(angle a) : float4x4Creates a right-handed rotation around the X axis.
RotationYmethod
public static fn RotationY(angle a) : float4x4Creates a right-handed rotation around the Y axis.
RotationZmethod
public static fn RotationZ(angle a) : float4x4Creates a right-handed rotation around the Z axis.
RotationAxismethod
public static fn RotationAxis(float3 axis, angle a) : float4x4Creates a right-handed rotation about a supplied unit axis. Does not normalize the axis.
LookAtmethod
public static fn LookAt(float3 eye, float3 target, float3 up) : float4x4Creates 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.
Perspectivemethod
public static fn Perspective(angle fov, float aspect, float near, float far) : float4x4Creates 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.
Orthomethod
public static fn Ortho(float left, float right, float bottom, float top, float near, float far) : float4x4Creates a right-handed orthographic matrix with depth [0, 1]. Supply distinct left/right, bottom/top, and near/far bounds.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.