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
transformof anXRView. - The
transformof anXRPose. - The
XRReferenceSpaceEventevent'stransformproperty, as found in theresetevent 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.