Sets a collection of transforms according to a parallel collection of anchors.
This method accepts a collection of
OVRAnchor-Transform pairs and attempts to get each anchor's pose, then apply it to the corresponding Transform.A
TrackingSpacePose has a position and rotation, either of which may be valid and tracked. If a component is not valid, it is ignored (not written to the corresponding Transform in anchors ). If it is valid but not tracked, it is still written to the corresponding Transform.Example usage:
class MyBehaviour : MonoBehaviour
{
[SerializeField] OVRCameraRig _cameraRig;
Dictionary\<OVRAnchor, Transform\> _anchors = new();
void Update()
{
OVRLocatable.UpdateSceneAnchorTransforms(_anchors, _cameraRig.transform, null);
}
}
This method is similar to calling
TryGetSceneAnchorPose on each
OVRAnchor in anchors and applying the result to each Transform in anchors . However, it correctly handles all permutations of pose validity and is more efficient to perform as a batch operation.
ParametersanchorsA collection of anchor-transform pairs. The pose of each
OVRAnchor is used to set its corresponding Transform.
trackingSpaceToWorldSpaceTransform(Optional) The transform to apply to each pose before setting the corresponding transform in anchors . If not null, this transform is applied to the pose, and this method then sets the world space transform. If null, no transform is applied and the local space transform is set.
trackingSpacePoses(Optional) If not null, trackingSpacePoses is cleared and then the
TrackingSpacePose of each
OVRAnchor is added to it. This is an optional parameter, but may be useful information since it also tells you whether a pose is valid and tracked.
ExceptionsArgumentNullExceptionThrown if anchors is null.