The XRRigidTransform
is a WebXR API interface that represents the 3D geometric transform described by a position and orientation.
XRRigidTransform
is used to specify transforms throughout the WebXR APIs, including:
- The offset and orientation relative to the parent reference space to use when creating a new reference space with
getOffsetReferenceSpace()
. - The
transform
of anXRView
. - The
transform
of anXRPose
. - The
XRReferenceSpaceEvent
event'stransform
property, as found in thereset
event received by anXRReferenceSpace
.
Using XRRigidTransform
in these places rather than bare arrays that provide the matrix data has an advantage. It automatically computes the inverse of the transform and even caches it making subsequent requests significantly faster.