Companion

object Companion

The companion object of Matrix4.

Functions

Link copied to clipboard
@JvmStatic
fun fromFloatArray(array: FloatArray): Matrix4

Creates a new Matrix4 instance from a float array.

Link copied to clipboard
@JvmStatic
fun identity(): Matrix4

Gets the identify of the Matrix4 instance.

Link copied to clipboard
@JvmStatic
fun lookAt(eye: Vector3, target: Vector3, upInput: Vector3): Matrix4

Creates and returns a 4x4 view matrix that transforms coordinates from world space to camera (view) space. This is a standard "look-at" matrix, robustly handling common edge cases.

Link copied to clipboard
@JvmStatic
fun ortho(left: Float, right: Float, bottom: Float, top: Float, near: Float, far: Float): Matrix4

Creates and returns a 4x4 orthographic projection matrix.

Link copied to clipboard
@JvmStatic
fun perspective(fovYDegrees: Float, aspectRatio: Float, nearPlane: Float, farPlane: Float): Matrix4

Creates and returns a 4x4 perspective projection matrix.

Link copied to clipboard
@JvmStatic
fun rotateByDegrees(degrees: Float, axis: Vector3): Matrix4

Creates and returns a 4x4 matrix representing a rotation around a given axis by an angle specified in degrees.

Link copied to clipboard
@JvmStatic
fun rotateXByDegrees(degrees: Float): Matrix4

Creates and returns a 4x4 matrix representing a rotation around the X-axis. The input angle is specified in degrees.

Link copied to clipboard
@JvmStatic
fun rotateYByDegrees(degrees: Float): Matrix4

Creates and returns a 4x4 matrix representing a rotation around the Y-axis. The input angle is specified in degrees.

Link copied to clipboard
@JvmStatic
fun rotateZByDegrees(degrees: Float): Matrix4

Creates and returns a 4x4 matrix representing a rotation around the Z-axis. The input angle is specified in degrees.

Link copied to clipboard
@JvmStatic
fun rotation(eulerAngles: EulerAngles): Matrix4

Creates and returns a 4x4 rotation matrix from the provided Euler angles (yaw, pitch, roll) specified in degrees.

Link copied to clipboard
@JvmStatic
fun scale(scale: Vector3): Matrix4

Creates and returns a 4x4 matrix representing a 3D scaling transformation.

Link copied to clipboard
@JvmStatic
fun translate(translation: Vector3): Matrix4

Creates and returns a 4x4 matrix representing a 3D translation.