Transform

fun Transform()

Creates an identity transform (no translation or rotation).

This is equivalent to being at position (0, 0, 0) with no rotation. Useful as a starting point for building transforms or representing the origin of a coordinate system.

fun Transform(data: FloatArray)

Creates a transform from a 4x4 transformation matrix.

The matrix should be in column-major order (OpenGL style) and contain a valid 3D transformation. This is commonly used when integrating with AR frameworks like ARCore or ARKit.

Parameters

data

A 16-element FloatArray representing a 4x4 transformation matrix in column-major order. Elements 12, 13, 14 should contain the x, y, z translation components.

Example

// From ARCore camera pose
val pose = frame.camera.pose
val transform = Transform(pose.toMatrix())
fun Transform(parcel: Parcel)