Package org.lwjgl.ovr

Class OVRTrackingState

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class OVRTrackingState
    extends Struct
    implements NativeResource
    Tracking state at a given absolute time (describes predicted HMD pose etc). Returned by GetTrackingState.

    Member documentation

    • HeadPose – Predicted head pose (and derivatives) at the requested absolute time. The look-ahead interval is equal to (HeadPose.TimeInSeconds - RawSensorData.TimeInSeconds).
    • StatusFlagsHeadPose tracking status described by ovrStatusBits.
    • HandPoses[2] – The most recent calculated pose for each hand when hand controller tracking is present. HandPoses[ovrHand_Left] refers to the left hand and HandPoses[ovrHand_Right] to the right hand. These values can be combined with ovrInputState for complete hand controller information.
    • HandStatusFlags[2]HandPoses status flags described by ovrStatusBits.
    • CalibratedOrigin – the pose of the origin captured during calibration.

      Like all other poses here, this is expressed in the space set by RecenterTrackingOrigin, or SpecifyTrackingOrigin and so will change every time either of those functions are called. This pose can be used to calculate where the calibrated origin lands in the new recentered space. If an application never calls RecenterTrackingOrigin or SpecifyTrackingOrigin, expect this value to be the identity pose and as such will point respective origin based on ovrTrackingOrigin requested when calling GetTrackingState.

    Layout

    
     struct ovrTrackingState {
         ovrPoseStatef HeadPose;
         unsigned int StatusFlags;
         ovrPoseStatef HandPoses[2];
         unsigned int HandStatusFlags[2];
         ovrPosef CalibratedOrigin;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HEADPOSE, STATUSFLAGS, HANDPOSES, HANDSTATUSFLAGS, CALIBRATEDORIGIN

        The struct member offsets.
    • Constructor Detail

      • OVRTrackingState

        public OVRTrackingState​(java.nio.ByteBuffer container)
        Creates a OVRTrackingState instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • StatusFlags

        public int StatusFlags()
        Returns the value of the StatusFlags field.
      • HandPoses

        public OVRPoseStatef HandPoses​(int index)
        Returns a OVRPoseStatef view of the struct at the specified index of the HandPoses field.
      • HandStatusFlags

        public java.nio.IntBuffer HandStatusFlags()
        Returns a IntBuffer view of the HandStatusFlags field.
      • HandStatusFlags

        public int HandStatusFlags​(int index)
        Returns the value at the specified index of the HandStatusFlags field.
      • CalibratedOrigin

        public OVRPosef CalibratedOrigin()
        Returns a OVRPosef view of the CalibratedOrigin field.
      • malloc

        public static OVRTrackingState malloc()
        Returns a new OVRTrackingState instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static OVRTrackingState calloc()
        Returns a new OVRTrackingState instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static OVRTrackingState create​(long address)
        Returns a new OVRTrackingState instance for the specified memory address.
      • createSafe

        @Nullable
        public static OVRTrackingState createSafe​(long address)
        Like create, but returns null if address is NULL.
      • createSafe

        @Nullable
        public static OVRTrackingState.Buffer createSafe​(long address,
                                                         int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static OVRTrackingState mallocStack()
        Returns a new OVRTrackingState instance allocated on the thread-local MemoryStack.
      • callocStack

        public static OVRTrackingState callocStack()
        Returns a new OVRTrackingState instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static OVRTrackingState mallocStack​(MemoryStack stack)
        Returns a new OVRTrackingState instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static OVRTrackingState callocStack​(MemoryStack stack)
        Returns a new OVRTrackingState instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nStatusFlags

        public static int nStatusFlags​(long struct)
        Unsafe version of StatusFlags().
      • nHandPoses

        public static OVRPoseStatef nHandPoses​(long struct,
                                               int index)
        Unsafe version of HandPoses.
      • nHandStatusFlags

        public static java.nio.IntBuffer nHandStatusFlags​(long struct)
        Unsafe version of HandStatusFlags().
      • nHandStatusFlags

        public static int nHandStatusFlags​(long struct,
                                           int index)
        Unsafe version of HandStatusFlags.