Mat4Stack

class Mat4Stack(val stackSize: Int = DEFAULT_STACK_SIZE) : Mat4

Constructors

Link copied to clipboard
fun Mat4Stack(stackSize: Int = DEFAULT_STACK_SIZE)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun dump()
Link copied to clipboard
operator fun get(i: Int): Float
operator fun get(row: Int, col: Int): Float
Link copied to clipboard
fun getCol(col: Int, result: MutableVec4f): MutableVec4f
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getRow(row: Int, result: MutableVec4f): MutableVec4f
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun invert(eps: Float = 0.0f): Mat4

Invert the matrix. Stores the result in this matrix.

fun invert(result: Mat4, eps: Float = 0.0f): Mat4

Invert the matrix. Stores the result in the specified Mat4.

Link copied to clipboard
fun mul(other: Mat4): Mat4

Post-multiplies this matrix with the given matrix, storing the result in this matrix.

fun mul(other: Mat4, result: Mat4): Mat4

Post-multiplies this matrix with the given matrix, storing the result in the specified matrix.

Link copied to clipboard
fun mulLeft(other: Mat4): Mat4

Pre-multiplies this matrix with the given matrix, storing the result in this matrix.

fun mulLeft(other: Mat4, result: Mat4): Mat4

Pre-multiplies this matrix with the given matrix, storing the result in the specified matrix.

Link copied to clipboard
fun pop(): Mat4Stack
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun rotate(rotationMat: Mat3)
fun rotate(quaternion: Vec4f)
fun rotate(axis: Vec3f, angle: Angle): Mat4
fun rotate(axis: Vec3f, angle: Angle, result: Mat4): Mat4
fun rotate(eulerX: Angle, eulerY: Angle, eulerZ: Angle): Mat4
fun rotate(eulerX: Angle, eulerY: Angle, eulerZ: Angle, result: Mat4): Mat4
fun rotate(ax: Float, ay: Float, az: Float, angle: Angle): Mat4
fun rotate(ax: Float, ay: Float, az: Float, angle: Angle, result: Mat4): Mat4
Link copied to clipboard
fun scale(scale: Vec3f): Mat4
fun scale(x: Float, y: Float = x, z: Float = y): Mat4
Link copied to clipboard
fun set(other: Mat3): Mat4
fun set(other: Mat4): Mat4
fun set(floats: List<Float>): Mat4
operator fun set(i: Int, value: Float)
operator fun set(row: Int, col: Int, value: Float)
fun set(xAxis: Vec3f, yAxis: Vec3f, zAxis: Vec3f, pos: Vec3f): Mat4

fun set(quaternion: Vec4f): Mat4
fun set(qx: Float, qy: Float, qz: Float, qw: Float): Mat4

Sets the matrix to a rotation matrix representing the quaternion.

fun set(translation: Vec3f, quaternion: Vec4f, scale: Vec3f): Mat4
fun set(tx: Float, ty: Float, tz: Float, qx: Float, qy: Float, qz: Float, qw: Float, sx: Float = 1.0f, sy: Float = 1.0f, sz: Float = 1.0f): Mat4

Sets the matrix to a rotation matrix representing the translation, quaternion, and scale.

Link copied to clipboard
fun setCol(col: Int, vec: Vec4f)
fun setCol(col: Int, vec: Vec3f, w: Float)
Link copied to clipboard
fun setFromEulerAngles(yaw: Angle, pitch: Angle, roll: Angle): Mat4

Sets this matrix to a rotation matrix from the given euler angles.

Link copied to clipboard
fun setRow(row: Int, value: Vec4f)
fun setRow(row: Int, vec: Vec3f, w: Float)
Link copied to clipboard

Sets this matrix to an identity matrix.

Link copied to clipboard
fun setToLookAt(direction: Vec3f, up: Vec3f): Mat4

Sets the matrix to a look at matrix with a direction and an up vector. Multiply with a translation matrix to get a camera model view matrix.

fun setToLookAt(position: Vec3f, lookAt: Vec3f, up: Vec3f): Mat4

Sets this matrix to a look at matrix with the given position, target and up vector.

Link copied to clipboard
fun setToOrthographic(left: Float, right: Float, bottom: Float, top: Float, near: Float, far: Float): Mat4

Sets the matrix to an orthographic projection.

Link copied to clipboard
fun setToPerspective(fovy: Float, aspect: Float, near: Float, far: Float): Mat4

Sets the matrix to a perspective projection

Link copied to clipboard
fun setToRotation(quaternion: Vec4f): Mat4
fun setToRotation(axis: Vec3f, angle: Angle): Mat4
fun setToRotation(ax: Float, ay: Float, az: Float, angle: Angle): Mat4
Link copied to clipboard
fun setToScaling(scale: Vec3f): Mat4
fun setToScaling(x: Float, y: Float, z: Float): Mat4
Link copied to clipboard
fun setToTranslate(translation: Vec3f): Mat4
Link copied to clipboard
fun setToTranslateAndScaling(translation: Vec3f, scale: Vec3f): Mat4
fun setToTranslateAndScaling(tx: Float, ty: Float, tz: Float, sx: Float, sy: Float, sz: Float): Mat4
Link copied to clipboard
fun setToWorld(position: Vec3f, forward: Vec3f, up: Vec3f): Mat4
Link copied to clipboard

Sets this matrix to all zeros.

Link copied to clipboard
Link copied to clipboard
fun toList(): List<Float>
Link copied to clipboard
Link copied to clipboard
fun translate(offset: Vec3f): Mat4
fun translate(x: Float, y: Float, z: Float): Mat4

Post-multiplies this matrix by a translation matrix.

fun translate(x: Float, y: Float, z: Float, result: Mat4): Mat4

Post-multiplies this matrix by a translation matrix and stores the result in the specified matrix

Link copied to clipboard
fun transpose(result: Mat4): Mat4

Properties

Link copied to clipboard
Link copied to clipboard
val det: Float
Link copied to clipboard
Link copied to clipboard
var m00: Float

XX: Typically the unrotated X component for scaling, also the cosine of the angle when rotated on the Y and/or Z axis. On Vector3 multiplication this value is multiplied with the source X component and added to the target X component.

Link copied to clipboard
var m01: Float

XY: Typically the negative sine of the angle when rotated on the Z axis. On Vector3 multiplication this value is multiplied with the source Y component and added to the target X component.

Link copied to clipboard
var m02: Float

XZ: Typically the sine of the angle when rotated on the Y axis. On Vector3 multiplication this value is multiplied with the source Z component and added to the target X component.

Link copied to clipboard
var m03: Float

XW: Typically the translation of the X component. On Vector3 multiplication this value is added to the target X component.

Link copied to clipboard
var m10: Float

YX: Typically the sine of the angle when rotated on the Z axis. On Vector3 multiplication this value is multiplied with the source X component and added to the target Y component.

Link copied to clipboard
var m11: Float

YY: Typically the unrotated Y component for scaling, also the cosine of the angle when rotated on the X and/or Z axis. On Vector3 multiplication this value is multiplied with the source Y component and added to the target Y component.

Link copied to clipboard
var m12: Float

YZ: Typically the negative sine of the angle when rotated on the X axis. On Vector3 multiplication this value is multiplied with the source Z component and added to the target Y component.

Link copied to clipboard
var m13: Float

YW: Typically the translation of the Y component. On Vector3 multiplication this value is added to the target Y component.

Link copied to clipboard
var m20: Float

ZX: Typically the negative sine of the angle when rotated on the Y axis. On Vector3 multiplication this value is multiplied with the source X component and added to the target Z component.

Link copied to clipboard
var m21: Float

ZY: Typical the sine of the angle when rotated on the X axis. On Vector3 multiplication this value is multiplied with the source Y component and added to the target Z component.

Link copied to clipboard
var m22: Float

ZZ: Typically the unrotated Z component for scaling, also the cosine of the angle when rotated on the X and/or Y axis. On Vector3 multiplication this value is multiplied with the source Z component and added to the target Z component.

Link copied to clipboard
var m23: Float

ZW: Typically the translation of the Z component. On Vector3 multiplication this value is added to the target Z component.

Link copied to clipboard
var m30: Float

WX: Typically the value zero. On Vec3f multiplication this value is ignored.

Link copied to clipboard
var m31: Float

WY: Typically the value zero. On Vec3f multiplication this value is ignored.

Link copied to clipboard
var m32: Float

WZ: Typically the value zero. On Vec3f multiplication this value is ignored.

Link copied to clipboard
var m33: Float

WW: Typically the value one. On Vec3f multiplication this value is ignored.

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