Matrix4

data class Matrix4
kotlin.Any
   ↳ androidx.ui.vectormath64.Matrix4

Summary

Public constructors

<init>(right: Vector3, up: Vector3, forward: Vector3, position: Vector3 = Vector3())

<init>(x: Vector4 = Vector4(x = 1.0f), y: Vector4 = Vector4(y = 1.0f), z: Vector4 = Vector4(z = 1.0f), w: Vector4 = Vector4(w = 1.0f))

Public methods

Unit

Unit

Float

Set this matrix to be the inverse of arg

operator Matrix4
dec()

operator Matrix4
div(v: Float)

operator Vector4
get(column: Int)

operator Float
get(column: Int, row: Int)

operator Vector4
get(column: MatrixColumn)

operator Float
get(column: MatrixColumn, row: Int)

Vector4
getRow(row: Int)

operator Matrix4
inc()

Float

Invert this.

operator Matrix4

Vector3

Transform arg of type Vector3 using the perspective transformation defined by this.

operator Matrix4
plus(v: Float)

Unit
rotateX(radians: Float)

Unit
rotateY(radians: Float)

Sets the upper 3x3 to a rotation of radians around Y

Unit
rotateZ(radians: Float)

Sets the upper 3x3 to a rotation of radians around Z

Unit
scale(x: Any, y: Float? = null, z: Float? = null)

Scale this matrix by a Vector3, Vector4, or x,y,z

operator Unit
set(column: Int, v: Vector4)

operator Unit
set(column: Int, row: Int, v: Float)

Unit

Sets the entire matrix to the matrix in arg.

Unit

Sets the translation vector in this homogeneous transformation matrix.

operator Matrix4

operator Matrix4

operator Vector4

operator Unit

FloatArray

String

Unit
translate(x: Any, y: Float = 0.0f, z: Float = 0.0f)

Translate this matrix by a Vector3, Vector4, or x,y,z

operator Matrix4

Companion functions

Matrix4

Matrix4

Matrix4

Matrix4
of(vararg a: Float)

Matrix4
rotationX(radians: Float)

Rotation of radians_ around X.

Matrix4
rotationY(radians: Float)

Rotation of radians_ around Y.

Matrix4
rotationZ(radians: Float)

Matrix4
translation(translation: Vector3)

Matrix4

Matrix4

Extension functions

From androidx.ui.vectormath64
Float?

Returns the given transform matrix as a Float describing a uniform scale, if the matrix is nothing but a symmetric 2D scale transform.

Offset?

Returns the given transform matrix as an Offset, if the matrix is nothing but a 2D translation.

Boolean

Whether the given matrix is the identity matrix.

Offset

Applies the given matrix as a perspective transform to the given point.

Rect

Returns a rect that bounds the result of applying the given matrix as a perspective transform to the given rect.

Properties

Float

Returns the determinant of this matrix.

Vector3

List<Float>

Vector3

Vector3

Vector3

Vector3

Vector3

Vector3

Matrix3

Vector4

Vector4

Vector4

Vector4

Public constructors

<init>

Matrix4(
    right: Vector3,
    up: Vector3,
    forward: Vector3,
    position: Vector3 = Vector3())

<init>

Matrix4(m: Matrix4)

<init>

Matrix4(
    x: Vector4 = Vector4(x = 1.0f),
    y: Vector4 = Vector4(y = 1.0f),
    z: Vector4 = Vector4(z = 1.0f),
    w: Vector4 = Vector4(w = 1.0f))

Public methods

assignColumns

fun assignColumns(other: Matrix4): Unit

assignFromStorage

fun assignFromStorage(storage: List<Float>): Unit

copyInverse

fun copyInverse(arg: Matrix4): Float

Set this matrix to be the inverse of arg

dec

operator fun dec(): Matrix4

div

operator fun div(v: Float): Matrix4

get

operator fun get(column: Int): Vector4

get

operator fun get(
    column: Int,
    row: Int
): Float

get

operator fun get(column: MatrixColumn): Vector4

get

operator fun get(
    column: MatrixColumn,
    row: Int
): Float

getRow

fun getRow(row: Int): Vector4

inc

operator fun inc(): Matrix4

invert

fun invert(): Float

Invert this.

minus

operator fun minus(v: Float): Matrix4

perspectiveTransform

fun perspectiveTransform(arg: Vector3): Vector3

Transform arg of type Vector3 using the perspective transformation defined by this.

plus

operator fun plus(v: Float): Matrix4

rotateX

fun rotateX(radians: Float): Unit

rotateY

fun rotateY(radians: Float): Unit

Sets the upper 3x3 to a rotation of radians around Y

rotateZ

fun rotateZ(radians: Float): Unit

Sets the upper 3x3 to a rotation of radians around Z

scale

fun scale(
    x: Any,
    y: Float? = null,
    z: Float? = null
): Unit

Scale this matrix by a Vector3, Vector4, or x,y,z

set

operator fun set(
    column: Int,
    v: Vector4
): Unit

set

operator fun set(
    column: Int,
    row: Int,
    v: Float
): Unit

setFrom

fun setFrom(arg: Matrix4): Unit

Sets the entire matrix to the matrix in arg.

setTranslationRaw

fun setTranslationRaw(
    x: Float,
    y: Float,
    z: Float
): Unit

Sets the translation vector in this homogeneous transformation matrix.

times

operator fun times(v: Float): Matrix4

times

operator fun times(m: Matrix4): Matrix4

times

operator fun times(v: Vector4): Vector4

timesAssign

operator fun timesAssign(m: Matrix4): Unit

toFloatArray

fun toFloatArray(): FloatArray

toString

fun toString(): String

translate

fun translate(
    x: Any,
    y: Float = 0.0f,
    z: Float = 0.0f
): Unit

Translate this matrix by a Vector3, Vector4, or x,y,z

unaryMinus

operator fun unaryMinus(): Matrix4

Properties

determinant

val determinant: Float

Returns the determinant of this matrix.

forward

inline var forward: Vector3

m4storage

inline val m4storage: List<Float>

position

inline var position: Vector3

right

inline var right: Vector3

rotation

val rotation: Vector3

scale

inline val scale: Vector3

translation

inline val translation: Vector3

up

inline var up: Vector3

upperLeft

inline val upperLeft: Matrix3

w

var w: Vector4

x

var x: Vector4

y

var y: Vector4

z

var z: Vector4

Companion functions

diagonal3

fun diagonal3(scale: Vector3): Matrix4

diagonal3Values

fun diagonal3Values(
    x: Float,
    y: Float,
    z: Float
): Matrix4

identity

fun identity(): Matrix4

of

fun of(vararg a: Float): Matrix4

rotationX

fun rotationX(radians: Float): Matrix4

Rotation of radians_ around X.

rotationY

fun rotationY(radians: Float): Matrix4

Rotation of radians_ around Y.

rotationZ

fun rotationZ(radians: Float): Matrix4

translation

fun translation(translation: Vector3): Matrix4

translationValues

fun translationValues(
    x: Float,
    y: Float,
    z: Float
): Matrix4

zero

fun zero(): Matrix4