Mat4

data class Mat4(var x: Float4 = Float4(x = 1.0f), var y: Float4 = Float4(y = 1.0f), var z: Float4 = Float4(z = 1.0f), var w: Float4 = Float4(w = 1.0f))

A 4×4 column-major matrix of Float values.

Stored as four column vectors x, y, z, and w. Default-constructed as the identity matrix.

Mat4 m:
m[0]=x m[1]=y m[2]=z m[3]=w

Convenience accessors:

  • right / up / forward: the upper-left 3×3 basis vectors

  • position: the translation component (column w.xyz)

  • scale: per-axis scale factors (lengths of the basis vectors)

  • rotation: Euler angles extracted from the matrix

  • upperLeft: the upper-left Mat3 submatrix

Constructors

Link copied to clipboard
constructor(x: Float4 = Float4(x = 1.0f), y: Float4 = Float4(y = 1.0f), z: Float4 = Float4(z = 1.0f), w: Float4 = Float4(w = 1.0f))
constructor(right: Float3, up: Float3, forward: Float3, position: Float3 = Float3())
constructor(m: Mat4)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var up: Float3
Link copied to clipboard
Link copied to clipboard
var w: Float4
Link copied to clipboard
var x: Float4
Link copied to clipboard
var y: Float4
Link copied to clipboard
var z: Float4

Functions

Link copied to clipboard
inline fun compareTo(m: Mat4, delta: Float = 0.0f): Mat4
inline fun compareTo(v: Float, delta: Float = 0.0f): Mat4
Link copied to clipboard
operator fun dec(): Mat4
Link copied to clipboard
operator fun div(v: Float): Mat4
Link copied to clipboard
inline fun equals(m: Mat4, delta: Float = 0.0f): Boolean
inline fun equals(v: Float, delta: Float = 0.0f): Boolean
Link copied to clipboard
operator fun get(column: MatrixColumn): Float4
operator fun get(column: Int): Float4
operator fun get(column: MatrixColumn, row: Int): Float
operator fun get(column: Int, row: Int): Float
Link copied to clipboard
operator fun inc(): Mat4
Link copied to clipboard
operator fun invoke(row: Int, column: Int): Float
operator fun invoke(row: Int, column: Int, v: Float)
Link copied to clipboard
operator fun minus(v: Float): Mat4
Link copied to clipboard
operator fun plus(v: Float): Mat4
Link copied to clipboard
operator fun set(column: Int, v: Float4)
operator fun set(column: Int, row: Int, v: Float)
Link copied to clipboard
operator fun times(v: Float4): Float4
operator fun times(m: Mat4): Mat4
operator fun times(v: Float): Mat4
Link copied to clipboard
fun toEulerAngles(order: RotationsOrder = RotationsOrder.ZYX): Float3
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
operator fun unaryMinus(): Mat4