Interface VRAPI

All Known Implementing Classes:
LWJGLOpenVR, OculusVR, OpenVR, OSVR

public interface VRAPI
An interface that represents a VR system. This interface has to be implemented in order to wrap underlying VR system (OpenVR, OSVR, ...)
  • Method Details

    • initialize

      boolean initialize()
      Initialize this object from a VR system. All the native bindings to underlying VR system should be done within this method.
      Returns:
      true if the initialization is a success and false otherwise.
    • initVRCompositor

      boolean initVRCompositor(boolean allowed)
      Initialize the VR compositor that will be used for rendering.
      Parameters:
      allowed - true if the use of VR compositor is allowed and false otherwise.
      Returns:
      true if the initialization is a success and false otherwise.
    • getVRSystem

      Object getVRSystem()
      Get the object that wraps natively the VR system.
      Returns:
      the object that wraps natively the VR system.
    • getCompositor

      Object getCompositor()
      Get the object that wraps natively the VR compositor.
      Returns:
      the object that wraps natively the VR system.
    • getName

      String getName()
      Get the name of the underlying VR system.
      Returns:
      the name of the underlying VR system.
    • getVRinput

      VRInputAPI getVRinput()
      Get the input provided by the underlying VR system.
      Returns:
      the input provided by the underlying VR system.
    • setFlipEyes

      void setFlipEyes(boolean set)
      Flip the left and right eye.
      Parameters:
      set - true if the eyes has to be flipped and false otherwise.
    • printLatencyInfoToConsole

      void printLatencyInfoToConsole(boolean set)
      Set if latency information has to be logged.
      Parameters:
      set - true if latency information has to be logged and false otherwise.
    • getDisplayFrequency

      int getDisplayFrequency()
      Get the Head Mounted Device (HMD) display frequency.
      Returns:
      the Head Mounted Device (HMD) display frequency.
    • destroy

      void destroy()
      Close the link with underlying VR system and free all attached resources.
    • isInitialized

      boolean isInitialized()
      Check if the VR API is initialized.
      Returns:
      true if the VR API is initialized and false otherwise.
      See Also:
    • reset

      void reset()
      Reset the VR system. After a call to this method, the current position of the HMD should be the origin (i-e the observer without any combined transformation).
    • getRenderSize

      void getRenderSize(Vector2f store)
      Get the size of a Head Mounted Device (HMD) rendering area in pixels.
      Parameters:
      store - the size of a Head Mounted Device (HMD) rendering area in pixels (modified).
    • getInterpupillaryDistance

      float getInterpupillaryDistance()
      Get the Head Mounted Device (HMD) interpupilar distance in meters.
      Returns:
      the Head Mounted Device (HMD) interpupilar distance in meters.
    • getOrientation

      Quaternion getOrientation()
      Get the Head Mounted Device (HMD) orientation.
      Returns:
      the Head Mounted Device (HMD) orientation.
    • getPosition

      Vector3f getPosition()
      Get the Head Mounted Device (HMD) position.
      Returns:
      the Head Mounted Device (HMD) orientation.
    • getPositionAndOrientation

      void getPositionAndOrientation(Vector3f storePos, Quaternion storeRot)
      Get the Head Mounted Device (HMD) position and orientation.
      Parameters:
      storePos - the Head Mounted Device (HMD) position (modified).
      storeRot - the Head Mounted Device (HMD) rotation (modified).
    • updatePose

      void updatePose()
      Update Head Mounted Device (HMD) pose internal storage. This method should be called before other calls to HMD position/orientation access.
    • getHMDMatrixProjectionLeftEye

      Matrix4f getHMDMatrixProjectionLeftEye(Camera cam)
      Get the Head Mounted Device (HMD) left eye projection matrix.
      Parameters:
      cam - the camera attached to the left eye.
      Returns:
      the Head Mounted Device (HMD) left eye projection matrix.
    • getHMDMatrixProjectionRightEye

      Matrix4f getHMDMatrixProjectionRightEye(Camera cam)
      Get the Head Mounted Device (HMD) right eye projection matrix.
      Parameters:
      cam - the camera attached to the right eye.
      Returns:
      the Head Mounted Device (HMD) right eye projection matrix.
    • getHMDVectorPoseLeftEye

      Vector3f getHMDVectorPoseLeftEye()
      Get the Head Mounted Device (HMD) left eye pose (position of the eye from the head) as a vector.
      Returns:
      the Head Mounted Device (HMD) left eye pose as a vector.
    • getHMDVectorPoseRightEye

      Vector3f getHMDVectorPoseRightEye()
      Get the Head Mounted Device (HMD) right eye pose (position of the eye from the head) as a vector.
      Returns:
      the Head Mounted Device (HMD) right eye pose as a vector.
    • getHMDMatrixPoseLeftEye

      Matrix4f getHMDMatrixPoseLeftEye()
      Returns the transform between the view space and left eye space. Eye space is the per-eye flavor of view space that provides stereo disparity. Instead of Model * View * Projection the model is Model * View * Eye * Projection. Normally View and Eye will be multiplied together and treated as View. This matrix incorporates the user's interpupillary distance (IPD).
      Returns:
      the transform between the view space and eye space.
    • getHMDMatrixPoseRightEye

      Matrix4f getHMDMatrixPoseRightEye()
      Returns the transform between the view space and right eye space. Eye space is the per-eye flavor of view space that provides stereo disparity. Instead of Model * View * Projection the model is Model * View * Eye * Projection. Normally View and Eye will be multiplied together and treated as View. This matrix incorporates the user's interpupillary distance (IPD).
      Returns:
      the transform between the view space and eye space.
    • getType

      HmdType getType()
      Get the Head Mounted Device (HMD) type.
      Returns:
      the Head Mounted Device (HMD) type.
    • getSeatedToAbsolutePosition

      Vector3f getSeatedToAbsolutePosition()
      Get the seated to absolute position.
      Returns:
      the seated to absolute position.