Matrix44

@Serializable
data class Matrix44(val c0r0: Double = 0.0, val c1r0: Double = 0.0, val c2r0: Double = 0.0, val c3r0: Double = 0.0, val c0r1: Double = 0.0, val c1r1: Double = 0.0, val c2r1: Double = 0.0, val c3r1: Double = 0.0, val c0r2: Double = 0.0, val c1r2: Double = 0.0, val c2r2: Double = 0.0, val c3r2: Double = 0.0, val c0r3: Double = 0.0, val c1r3: Double = 0.0, val c2r3: Double = 0.0, val c3r3: Double = 0.0) : LinearType<Matrix44> (source)

A 4x4 matrix with double precision

Constructors

Link copied to clipboard
constructor(c0r0: Double = 0.0, c1r0: Double = 0.0, c2r0: Double = 0.0, c3r0: Double = 0.0, c0r1: Double = 0.0, c1r1: Double = 0.0, c2r1: Double = 0.0, c3r1: Double = 0.0, c0r2: Double = 0.0, c1r2: Double = 0.0, c2r2: Double = 0.0, c3r2: Double = 0.0, c0r3: Double = 0.0, c1r3: Double = 0.0, c2r3: Double = 0.0, c3r3: Double = 0.0)

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
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The determinant of the 4x4 matrix, from the 2x2 minors of its upper and lower two rows

Link copied to clipboard

Inversed version of the 4x4 matrix.

Link copied to clipboard

The 3x3 top-left part of the 4x4 matrix

Link copied to clipboard

The trace of the 4x4 matrix

Link copied to clipboard

Returns a transposed version of the matrix

Functions

Link copied to clipboard
open operator override fun div(scale: Double): Matrix44

Divides the current object by the given scale factor.

Link copied to clipboard
operator fun get(index: Int): Vector4

Return a column vector

Link copied to clipboard
open operator override fun minus(right: Matrix44): Matrix44

Matrix subtraction

Link copied to clipboard
open operator override fun plus(right: Matrix44): Matrix44

Matrix addition

Link copied to clipboard
open operator override fun times(scale: Double): Matrix44

Multiplies all the elements in the 4x4 matrix with a scalar

operator fun times(mat: Matrix44): Matrix44

Multiplies this 4x4 matrix with another 4x4 matrix. With fused multiply-adds: the products are bound by the number of instructions, fused multiply-adds halve them.

operator fun times(v: Vector4): Vector4

Multiplies the 4x4 matrix with a vector 4. Plain multiplications and additions, which are as precise here as fused multiply-adds and have shorter dependency chains.

Link copied to clipboard

This matrix multiplied by the scale matrix of (x, y, z), exactly this * Matrix44.scale(x, y, z), without making the scale matrix

Link copied to clipboard

This matrix multiplied by the translation matrix of (x, y, z), exactly this * Matrix44.translate(x, y, z), without making the translation matrix

Link copied to clipboard

Convert matrix to a DoubleArray in row-major order

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
@JvmName(name = "matrix44Transform")
fun Matrix44.transform(builder: TransformBuilder.() -> Unit): Matrix44

Matrix44 transform helper