androidx.xr.runtime.math


Classes

Matrix4

An immutable 4x4 matrix that represents translation, scale, and rotation.

Pose

Represents an immutable rigid transformation from one coordinate space to another.

Quaternion

Represents a rotation component in three-dimensional space.

Ray

Represents a ray in 3D space.

Vector2

Represents a position in the 2D plane.

Vector3

Represents a three-dimensional position in space.

Top-level functions summary

Float
clamp(x: Float, min: Float, max: Float)

Clamps a value.

Float
lerp(a: Float, b: Float, t: Float)

Linearly interpolates between two values.

Float
toDegrees(angleInRadians: Float)

Converts angleInRadians from radians to degrees.

Float
toRadians(angleInDegrees: Float)

Converts angleInDegrees from degrees to radians.

Top-level functions

fun clamp(x: Float, min: Float, max: Float): Float

Clamps a value.

Parameters
x: Float

the value to clamp.

min: Float

the minimum value.

max: Float

the maximum value.

fun lerp(a: Float, b: Float, t: Float): Float

Linearly interpolates between two values.

Parameters
a: Float

the start value.

b: Float

the end value.

t: Float

the ratio between the two floats.

Returns
Float

the interpolated value between a and b.

fun toDegrees(angleInRadians: Float): Float

Converts angleInRadians from radians to degrees.

fun toRadians(angleInDegrees: Float): Float

Converts angleInDegrees from degrees to radians.