Class VRSpatialAnchors

  • public class VRSpatialAnchors
    extends java.lang.Object
    • Method Detail

      • nVRSpatialAnchors_CreateSpatialAnchorFromDescriptor

        public static int nVRSpatialAnchors_CreateSpatialAnchorFromDescriptor​(long pchDescriptor,
                                                                              long pHandleOut)
      • VRSpatialAnchors_CreateSpatialAnchorFromDescriptor

        public static int VRSpatialAnchors_CreateSpatialAnchorFromDescriptor​(java.nio.ByteBuffer pchDescriptor,
                                                                             java.nio.IntBuffer pHandleOut)
        public static int VRSpatialAnchors_CreateSpatialAnchorFromDescriptor​(java.lang.CharSequence pchDescriptor,
                                                                             java.nio.IntBuffer pHandleOut)
        Returns a handle for an spatial anchor described by "descriptor". On success, pHandle will contain a handle valid for this session. Caller can wait for an event or occasionally poll GetSpatialAnchorPose to find the virtual coordinate associated with this anchor.
      • nVRSpatialAnchors_CreateSpatialAnchorFromPose

        public static int nVRSpatialAnchors_CreateSpatialAnchorFromPose​(int unDeviceIndex,
                                                                        int eOrigin,
                                                                        long pPose,
                                                                        long pHandleOut)
        Unsafe version of: CreateSpatialAnchorFromPose
      • VRSpatialAnchors_CreateSpatialAnchorFromPose

        public static int VRSpatialAnchors_CreateSpatialAnchorFromPose​(int unDeviceIndex,
                                                                       int eOrigin,
                                                                       SpatialAnchorPose pPose,
                                                                       java.nio.IntBuffer pHandleOut)
        Returns a handle for an new spatial anchor at pPose.

        On success, pHandle will contain a handle valid for this session. Caller can wait for an event or occasionally poll GetSpatialAnchorDescriptor to find the permanent descriptor for this pose. The result of GetSpatialAnchorPose may evolve from this initial position if the driver chooses to update it. The anchor will be associated with the driver that provides unDeviceIndex, and the driver may use that specific device as a hint for how to best create the anchor. The eOrigin must match whatever tracking origin you are working in (seated/standing/raw).

        This should be called when the user is close to (and ideally looking at/interacting with) the target physical location. At that moment, the driver will have the most information about how to recover that physical point in the future, and the quality of the anchor (when the descriptor is re-used) will be highest. The caller may decide to apply offsets from this initial pose, but is advised to stay relatively close to the original pose location for highest fidelity.

      • nVRSpatialAnchors_GetSpatialAnchorPose

        public static int nVRSpatialAnchors_GetSpatialAnchorPose​(int unHandle,
                                                                 int eOrigin,
                                                                 long pPoseOut)
        Unsafe version of: GetSpatialAnchorPose
      • VRSpatialAnchors_GetSpatialAnchorPose

        public static int VRSpatialAnchors_GetSpatialAnchorPose​(int unHandle,
                                                                int eOrigin,
                                                                SpatialAnchorPose pPoseOut)
        Get the pose for a given handle.

        This is intended to be cheap enough to call every frame (or fairly often) so that the driver can refine this position when it has more information available.

      • nVRSpatialAnchors_GetSpatialAnchorDescriptor

        public static int nVRSpatialAnchors_GetSpatialAnchorDescriptor​(int unHandle,
                                                                       long pchDescriptorOut,
                                                                       long punDescriptorBufferLenInOut)
        Unsafe version of: GetSpatialAnchorDescriptor
      • VRSpatialAnchors_GetSpatialAnchorDescriptor

        public static int VRSpatialAnchors_GetSpatialAnchorDescriptor​(int unHandle,
                                                                      java.nio.ByteBuffer pchDescriptorOut,
                                                                      java.nio.IntBuffer punDescriptorBufferLenInOut)
        Get the descriptor for a given handle.

        This will be empty for handles where the driver has not yet built a descriptor. It will be the application-supplied descriptor for previously saved anchors that the application is requesting poses for. If the driver has called UpdateSpatialAnchorDescriptor() already in this session, it will be the descriptor provided by the driver.

        true if the descriptor fits into the buffer, else false. Buffer size should be at least k_unMaxSpatialAnchorDescriptorSize