androidx.xr.runtime.math


Classes

BoundingBox

Represents an axis-aligned bounding box in 3D space, defined by its minimum and maximum corner points.

FloatSize2d

Size of a 2d object represented as a Float, such as the dimensions of a panel in meters.

FloatSize3d

Size of a 3d object represented as a Float, such as the dimensions of a spatial volume in meters.

IntSize2d

Size of a 2d object represented as an Int, such as the dimensions of the panel in pixels.

Matrix3

An immutable 3x3 matrix that represents rotation and scale.

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.

Vector4

Represents a four-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.