Package org.lwjgl.ovr

Class OVR

java.lang.Object
org.lwjgl.ovr.OVR

public class OVR extends Object
Native bindings to libOVR, using the Oculus SDK C API.
  • Field Details

  • Method Details

    • novr_Initialize

      public static int novr_Initialize(long params)
      Unsafe version of: Initialize
    • ovr_Initialize

      public static int ovr_Initialize(@Nullable OVRInitParams params)
      Initialize LibOVR for application usage. This includes finding and loading the LibOVRRT shared library. No LibOVR API functions, other than GetLastErrorInfo and _Detect, can be called unless Initialize succeeds. A successful call to ovr_Initialize must be eventually followed by a call to Shutdown. ovr_Initialize calls are idempotent. Calling ovr_Initialize twice does not require two matching calls to ovr_Shutdown. If already initialized, the return value is Success.

      LibOVRRT shared library search order:

      1. Current working directory (often the same as the application directory).
      2. Module directory (usually the same as the application directory, but not if the module is a separate shared library).
      3. Application directory
      4. Development directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled, which is off by default).
      5. Standard OS shared library search location(s) (OS-specific).
      Parameters:
      params - specifies custom initialization options. May be NULL to indicate default options when using the CAPI shim. If you are directly calling the LibOVRRT version of ovr_Initialize in the LibOVRRT DLL then this must be valid and include Init_RequestVersion.
      Returns:
      an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information. Example failed results include:
    • ovr_Shutdown

      public static void ovr_Shutdown()
      Shuts down LibOVR.

      A successful call to Initialize must be eventually matched by a call to ovr_Shutdown. After calling ovr_Shutdown, no LibOVR functions can be called except GetLastErrorInfo or another Initialize. ovr_Shutdown invalidates all pointers, references, and created objects previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded by ovr_Shutdown.

    • novr_GetLastErrorInfo

      public static void novr_GetLastErrorInfo(long errorInfo)
      Unsafe version of: GetLastErrorInfo
    • ovr_GetLastErrorInfo

      public static void ovr_GetLastErrorInfo(OVRErrorInfo errorInfo)
      Returns information about the most recent failed return value by the current thread for this library.

      This function itself can never generate an error. The last error is never cleared by LibOVR, but will be overwritten by new errors. Do not use this call to determine if there was an error in the last API call as successful API calls don't clear the last OVRErrorInfo. To avoid any inconsistency, GetLastErrorInfo should be called immediately after an API function that returned a failed ovrResult, with no other API functions called in the interim.

      Parameters:
      errorInfo - The last OVRErrorInfo for the current thread
    • novr_GetVersionString

      public static long novr_GetVersionString()
      Unsafe version of: GetVersionString
    • ovr_GetVersionString

      public static String ovr_GetVersionString()
      Returns the version string representing the LibOVRRT version.

      The returned string pointer is valid until the next call to Shutdown.

      Note that the returned version string doesn't necessarily match the current OVR_MAJOR_VERSION, etc., as the returned string refers to the LibOVRRT shared library version and not the locally compiled interface version.

      The format of this string is subject to change in future versions and its contents should not be interpreted.

      Returns:
      a UTF8-encoded null-terminated version string
    • novr_TraceMessage

      public static int novr_TraceMessage(int level, long message)
      Unsafe version of: TraceMessage
    • ovr_TraceMessage

      public static int ovr_TraceMessage(int level, ByteBuffer message)
      Writes a message string to the LibOVR tracing mechanism (if enabled).

      This message will be passed back to the application via the OVRLogCallback if it was registered.

      Parameters:
      level - an ovrLogLevel constant. One of:
      LogLevel_DebugLogLevel_InfoLogLevel_Error
      message - a UTF8-encoded null-terminated string
      Returns:
      the strlen of the message or a negative value if the message is too large
    • ovr_TraceMessage

      public static int ovr_TraceMessage(int level, CharSequence message)
      Writes a message string to the LibOVR tracing mechanism (if enabled).

      This message will be passed back to the application via the OVRLogCallback if it was registered.

      Parameters:
      level - an ovrLogLevel constant. One of:
      LogLevel_DebugLogLevel_InfoLogLevel_Error
      message - a UTF8-encoded null-terminated string
      Returns:
      the strlen of the message or a negative value if the message is too large
    • novr_IdentifyClient

      public static int novr_IdentifyClient(long identity)
      Unsafe version of: IdentifyClient
    • ovr_IdentifyClient

      public static int ovr_IdentifyClient(ByteBuffer identity)
      Identifies client application info.

      The string is one or more newline-delimited lines of optional info indicating engine name, engine version, engine plugin name, engine plugin version, engine editor. The order of the lines is not relevant. Individual lines are optional. A newline is not necessary at the end of the last line. Call after Initialize and before the first call to Create. Each value is limited to 20 characters. Key names such as 'EngineName:', 'EngineVersion:' do not count towards this limit.

      
       EngineName: %s\n
       EngineVersion: %s\n
       EnginePluginName: %s\n
       EnginePluginVersion: %s\n
       EngineEditor: <boolean> ('true' or 'false')\n

      Example code:

      
       ovr_IdentifyClient(
           "EngineName: Unity\n" +
           "EngineVersion: 5.3.3\n" +
           "EnginePluginName: OVRPlugin\n" +
           "EnginePluginVersion: 1.2.0\n" +
           "EngineEditor: true");
      Parameters:
      identity - specifies one or more newline-delimited lines of optional info
    • ovr_IdentifyClient

      public static int ovr_IdentifyClient(CharSequence identity)
      Identifies client application info.

      The string is one or more newline-delimited lines of optional info indicating engine name, engine version, engine plugin name, engine plugin version, engine editor. The order of the lines is not relevant. Individual lines are optional. A newline is not necessary at the end of the last line. Call after Initialize and before the first call to Create. Each value is limited to 20 characters. Key names such as 'EngineName:', 'EngineVersion:' do not count towards this limit.

      
       EngineName: %s\n
       EngineVersion: %s\n
       EnginePluginName: %s\n
       EnginePluginVersion: %s\n
       EngineEditor: <boolean> ('true' or 'false')\n

      Example code:

      
       ovr_IdentifyClient(
           "EngineName: Unity\n" +
           "EngineVersion: 5.3.3\n" +
           "EnginePluginName: OVRPlugin\n" +
           "EnginePluginVersion: 1.2.0\n" +
           "EngineEditor: true");
      Parameters:
      identity - specifies one or more newline-delimited lines of optional info
    • novr_GetHmdColorDesc

      public static void novr_GetHmdColorDesc(long session, long __result)
      Unsafe version of: GetHmdColorDesc
    • ovr_GetHmdColorDesc

      public static ovrHmdColorDesc ovr_GetHmdColorDesc(long session, ovrHmdColorDesc __result)
      Returns native color space information about the current HMD.

      Initialize must be called prior to calling this function, otherwise call will fail.

      Parameters:
      session - specifies an ovrSession previously returned by Create or NULL
      __result - an ovrHmdColorDesc
    • novr_SetClientColorDesc

      public static int novr_SetClientColorDesc(long session, long colorDesc)
      Unsafe version of: SetClientColorDesc
    • ovr_SetClientColorDesc

      public static int ovr_SetClientColorDesc(long session, ovrHmdColorDesc colorDesc)
      Sets the color space actively being used by the client app.

      This value does not have to follow the color space provided in GetHmdColorDesc. It should reflect the color space the final rendered frame the client has submitted to the SDK. If this function is never called, the session will keep using the default color space deemed appropriate by the runtime. See remarks in ovrColorSpace enum for more info on default behavior.

      Initialize must be called prior to calling this function, otherwise call will fail.

      Parameters:
      session - an ovrSession previously returned by Create or NULL
      colorDesc - the color description to use for the current HMD
      Returns:
      an ovrResult indicating success or failure
    • novr_GetHmdDesc

      public static void novr_GetHmdDesc(long session, long __result)
      Unsafe version of: GetHmdDesc
    • ovr_GetHmdDesc

      public static OVRHmdDesc ovr_GetHmdDesc(long session, OVRHmdDesc __result)
      Returns information about the current HMD.

      Initialize must be called prior to calling this function, otherwise ovrHmdDesc::Type will be set to Hmd_None without checking for the HMD presence.

      For newer headsets being used on a game built against an old SDK version, we may return the ovrHmdType as Hmd_CV1 for backwards compatibility.

      Parameters:
      session - an ovrSession previously returned by Create or NULL
      __result - an OVRHmdDesc. If invoked with NULL session argument, ovrHmdDesc::Type to Hmd_None indicates that the HMD is not connected.
    • novr_GetTrackerCount

      public static int novr_GetTrackerCount(long session)
      Unsafe version of: GetTrackerCount
    • ovr_GetTrackerCount

      public static int ovr_GetTrackerCount(long session)
      Returns the number of attached trackers.

      The number of trackers may change at any time, so this function should be called before use as opposed to once on startup.

      For newer headsets being used on a game built against an old SDK version, we may simulate three CV1 trackers to maintain backwards compatibility.

      Parameters:
      session - an ovrSession previously returned by Create
    • novr_GetTrackerDesc

      public static void novr_GetTrackerDesc(long session, int trackerDescIndex, long __result)
      Unsafe version of: GetTrackerDesc
    • ovr_GetTrackerDesc

      public static OVRTrackerDesc ovr_GetTrackerDesc(long session, int trackerDescIndex, OVRTrackerDesc __result)
      Returns a given attached tracker description.

      Initialize must have first been called in order for this to succeed, otherwise the returned trackerDescArray will be zero-initialized. The data returned by this function can change at runtime.

      For newer headsets being used on a game built against an old SDK version, we may simulate three CV1 trackers to maintain backwards compatibility.

      Parameters:
      session - an ovrSession previously returned by Create
      trackerDescIndex - a tracker index. The valid indexes are in the range of 0 to the tracker count returned by GetTrackerCount.
      __result - an OVRTrackerDesc. An empty OVRTrackerDesc will be returned if trackerDescIndex is out of range.
    • novr_Create

      public static int novr_Create(long pSession, long pLuid)
      Unsafe version of: Create
    • ovr_Create

      public static int ovr_Create(PointerBuffer pSession, OVRGraphicsLuid pLuid)
      Creates a handle to a VR session.

      Upon success the returned ovrSession must be eventually freed with Destroy when it is no longer needed. A second call to Create will result in an error return value if the previous session has not been destroyed.

      Parameters:
      pSession - a pointer to an ovrSession which will be written to upon success
      pLuid - a system specific graphics adapter identifier that locates which graphics adapter has the HMD attached. This must match the adapter used by the application or no rendering output will be possible. This is important for stability on multi-adapter systems. An application that simply chooses the default adapter will not run reliably on multi-adapter systems.
      Returns:
      an ovrResult indicating success or failure. Upon failure the returned ovrSession will be NULL.
    • novr_Destroy

      public static void novr_Destroy(long session)
      Unsafe version of: Destroy
    • ovr_Destroy

      public static void ovr_Destroy(long session)
      Destroys the session.
      Parameters:
      session - an ovrSession previously returned by Create
    • novr_GetSessionStatus

      public static int novr_GetSessionStatus(long session, long sessionStatus)
      Unsafe version of: GetSessionStatus
    • ovr_GetSessionStatus

      public static int ovr_GetSessionStatus(long session, OVRSessionStatus sessionStatus)
      Returns status information for the application.
      Parameters:
      session - an ovrSession previously returned by Create
      sessionStatus - an OVRSessionStatus that is filled in
    • novr_IsExtensionSupported

      public static int novr_IsExtensionSupported(long session, int extension, long outExtensionSupported)
      Unsafe version of: IsExtensionSupported
    • ovr_IsExtensionSupported

      public static int ovr_IsExtensionSupported(long session, int extension, ByteBuffer outExtensionSupported)
      Queries extension support status.
      Parameters:
      session - an ovrSession previously returned by Create
      extension - extension to query
      outExtensionSupported - set to extension support status. True if supported.
      Returns:
      an ovrResult indicating success or failure. In the case of failure use GetLastErrorInfo to get more information.
    • novr_EnableExtension

      public static int novr_EnableExtension(long session, int extension)
      Unsafe version of: EnableExtension
    • ovr_EnableExtension

      public static int ovr_EnableExtension(long session, int extension)
      Enable extension. Extensions must be enabled after Create is called.
      Parameters:
      session - an ovrSession previously returned by Create
      extension - extension to enable.
      Returns:
      an ovrResult indicating success or failure. Extension is only enabled if successful. In the case of failure use GetLastErrorInfo to get more information.
    • novr_SetTrackingOriginType

      public static int novr_SetTrackingOriginType(long session, int origin)
      Unsafe version of: SetTrackingOriginType
    • ovr_SetTrackingOriginType

      public static int ovr_SetTrackingOriginType(long session, int origin)
      Sets the tracking origin type.

      When the tracking origin is changed, all of the calls that either provide or accept ovrPosef will use the new tracking origin provided.

      Parameters:
      session - an ovrSession previously returned by Create
      origin - an ovrTrackingOrigin to be used for all OVRPosef
    • novr_GetTrackingOriginType

      public static int novr_GetTrackingOriginType(long session)
      Unsafe version of: GetTrackingOriginType
    • ovr_GetTrackingOriginType

      public static int ovr_GetTrackingOriginType(long session)
      Gets the tracking origin state.
      Parameters:
      session - an ovrSession previously returned by Create
    • novr_RecenterTrackingOrigin

      public static int novr_RecenterTrackingOrigin(long session)
      Unsafe version of: RecenterTrackingOrigin
    • ovr_RecenterTrackingOrigin

      public static int ovr_RecenterTrackingOrigin(long session)
      Re-centers the sensor position and orientation.

      This resets the (x,y,z) positional components and the yaw orientation component of the tracking space for the HMD and controllers using the HMD's current tracking pose. If the caller requires some tweaks on top of the HMD's current tracking pose, consider using SpecifyTrackingOrigin instead.

      The roll and pitch orientation components are always determined by gravity and cannot be redefined. All future tracking will report values relative to this new reference position. If you are using ovrTrackerPoses then you will need to call GetTrackerPose after this, because the sensor position(s) will change as a result of this.

      The headset cannot be facing vertically upward or downward but rather must be roughly level otherwise this function will fail with Error_InvalidHeadsetOrientation.

      For more info, see the notes on each ovrTrackingOrigin enumeration to understand how recenter will vary slightly in its behavior based on the current ovrTrackingOrigin setting.

      Parameters:
      session - an ovrSession previously returned by Create
    • novr_SpecifyTrackingOrigin

      public static int novr_SpecifyTrackingOrigin(long session, long originPose)
      Unsafe version of: SpecifyTrackingOrigin
    • ovr_SpecifyTrackingOrigin

      public static int ovr_SpecifyTrackingOrigin(long session, OVRPosef originPose)
      Allows manually tweaking the sensor position and orientation.

      This function is similar to RecenterTrackingOrigin in that it modifies the (x,y,z) positional components and the yaw orientation component of the tracking space for the HMD and controllers.

      While ovr_RecenterTrackingOrigin resets the tracking origin in reference to the HMD's current pose, ovr_SpecifyTrackingOrigin allows the caller to explicitly specify a transform for the tracking origin. This transform is expected to be an offset to the most recent recentered origin, so calling this function repeatedly with the same originPose will keep nudging the recentered origin in that direction.

      There are several use cases for this function. For example, if the application decides to limit the yaw, or translation of the recentered pose instead of directly using the HMD pose the application can query the current tracking state via GetTrackingState, and apply some limitations to the HMD pose because feeding this pose back into this function. Similarly, this can be used to "adjust the seating position" incrementally in apps that feature seated experiences such as cockpit-based games.

      This function can emulate ovr_RecenterTrackingOrigin as such:

      
       ovrTrackingState ts = ovr_GetTrackingState(session, 0.0, ovrFalse);
       ovr_SpecifyTrackingOrigin(session, ts.HeadPose.ThePose);

      The roll and pitch orientation components are determined by gravity and cannot be redefined. If you are using ovrTrackerPoses then you will need to call GetTrackerPose after this, because the sensor position(s) will change as a result of this.

      For more info, see the notes on each ovrTrackingOrigin enumeration to understand how recenter will vary slightly in its behavior based on the current ovrTrackingOrigin setting.

      Parameters:
      session - an ovrSession previously returned by Create
      originPose - specifies a pose that will be used to transform the current tracking origin
    • novr_ClearShouldRecenterFlag

      public static void novr_ClearShouldRecenterFlag(long session)
      Unsafe version of: ClearShouldRecenterFlag
    • ovr_ClearShouldRecenterFlag

      public static void ovr_ClearShouldRecenterFlag(long session)
      Clears the ShouldRecenter status bit in OVRSessionStatus.

      Clears the ShouldRecenter status bit in OVRSessionStatus, allowing further recenter requests to be detected. Since this is automatically done by RecenterTrackingOrigin and SpecifyTrackingOrigin, this function only needs to be called when application is doing its own re-centering logic.

      Parameters:
      session - an ovrSession previously returned by Create
    • novr_GetTrackingState

      public static void novr_GetTrackingState(long session, double absTime, boolean latencyMarker, long __result)
      Unsafe version of: GetTrackingState
    • ovr_GetTrackingState

      public static OVRTrackingState ovr_GetTrackingState(long session, double absTime, boolean latencyMarker, OVRTrackingState __result)
      Returns tracking state reading based on the specified absolute system time.

      Pass an absTime value of 0.0 to request the most recent sensor reading. In this case both PredictedPose and SamplePose will have the same value.

      This may also be used for more refined timing of front buffer rendering logic, and so on.

      This may be called by multiple threads.

      Parameters:
      session - an ovrSession previously returned by Create
      absTime - the absolute future time to predict the return OVRTrackingState value. Use 0 to request the most recent tracking state.
      latencyMarker - specifies that this call is the point in time where the "App-to-Mid-Photon" latency timer starts from. If a given ovrLayer provides "SensorSampleTime", that will override the value stored here.
      __result - the OVRTrackingState that is predicted for the given absTime
    • novr_GetDevicePoses

      public static int novr_GetDevicePoses(long session, long deviceTypes, int deviceCount, double absTime, long outDevicePoses)
      Unsafe version of: GetDevicePoses
      Parameters:
      deviceCount - number of queried poses. This number must match the length of the outDevicePoses and deviceTypes array.
    • ovr_GetDevicePoses

      public static int ovr_GetDevicePoses(long session, IntBuffer deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)
      Returns an array of poses, where each pose matches a device type provided by the deviceTypes array parameter.

      If any pose cannot be retrieved, it will return a reason for the missing pose and the device pose will be zeroed out with a pose quaternion [x=0, y=0, z=0, w=1].

      Parameters:
      session - an ovrSession previously returned by Create
      deviceTypes - array of device types to query for their poses
      absTime - specifies the absolute future time to predict the return ovrTrackingState value. Use 0 to request the most recent tracking state.
      outDevicePoses - array of poses, one for each device type in deviceTypes arrays
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success
    • novr_GetTrackerPose

      public static void novr_GetTrackerPose(long session, int trackerPoseIndex, long __result)
      Unsafe version of: GetTrackerPose
    • ovr_GetTrackerPose

      public static OVRTrackerPose ovr_GetTrackerPose(long session, int trackerPoseIndex, OVRTrackerPose __result)
      Returns the OVRTrackerPose for the given attached tracker.

      For newer headsets being used on a game built against an old SDK version, we may simulate three CV1 trackers to maintain backwards compatibility.

      Parameters:
      session - an ovrSession previously returned by Create
      trackerPoseIndex - index of the tracker being requested.
    • novr_GetInputState

      public static int novr_GetInputState(long session, int controllerType, long inputState)
      Unsafe version of: GetInputState
    • ovr_GetInputState

      public static int ovr_GetInputState(long session, int controllerType, OVRInputState inputState)
      Returns the most recent input state for controllers, without positional tracking info. Developers can tell whether the same state was returned by checking the PacketNumber.
      Parameters:
      session - an ovrSession previously returned by Create
      controllerType - which controllers the input will be returned for
      inputState - the input state that will be filled in
      Returns:
      Success if the new state was successfully obtained
    • novr_GetConnectedControllerTypes

      public static int novr_GetConnectedControllerTypes(long session)
      Unsafe version of: GetConnectedControllerTypes
    • ovr_GetConnectedControllerTypes

      public static int ovr_GetConnectedControllerTypes(long session)
      Returns controller types connected to the system OR'ed together.
      Parameters:
      session - an ovrSession previously returned by Create
    • novr_GetTouchHapticsDesc

      public static void novr_GetTouchHapticsDesc(long session, int controllerType, long __result)
      Unsafe version of: GetTouchHapticsDesc
    • ovr_GetTouchHapticsDesc

      public static OVRTouchHapticsDesc ovr_GetTouchHapticsDesc(long session, int controllerType, OVRTouchHapticsDesc __result)
      Gets information about Haptics engine for the specified Touch controller.
      Parameters:
      session - an ovrSession previously returned by Create
      controllerType - the controller to retrieve the information from
      __result - an OVRTouchHapticsDesc
    • novr_SetControllerVibration

      public static int novr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)
      Unsafe version of: SetControllerVibration
    • ovr_SetControllerVibration

      public static int ovr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)
      Sets constant vibration (with specified frequency and amplitude) to a controller.

      Note: ovr_SetControllerVibration cannot be used interchangeably with SubmitControllerVibration.

      This method should be called periodically, vibration lasts for a maximum of 2.5 seconds.

      Parameters:
      session - an ovrSession previously returned by Create
      controllerType - the controller to set the vibration to
      frequency - the vibration frequency. Supported values are: 0.0 (disabled), 0.5 and 1.0. Non valid values will be clamped.
      amplitude - the vibration amplitude in the [0.0, 1.0] range
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_DeviceUnavailable: The call succeeded but the device referred to by controllerType is not available.
    • novr_SubmitControllerVibration

      public static int novr_SubmitControllerVibration(long session, int controllerType, long buffer)
      Unsafe version of: SubmitControllerVibration
    • ovr_SubmitControllerVibration

      public static int ovr_SubmitControllerVibration(long session, int controllerType, OVRHapticsBuffer buffer)
      Submits a Haptics buffer (used for vibration) to Touch (only) controllers.

      Note: ovr_SubmitControllerVibration cannot be used interchangeably with SetControllerVibration.

      Parameters:
      session - an ovrSession previously returned by Create
      controllerType - the controller where the Haptics buffer will be played
      buffer - the Haptics buffer containing amplitude samples to be played
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_DeviceUnavailable: The call succeeded but the device referred to by controllerType is not available.
    • novr_GetControllerVibrationState

      public static int novr_GetControllerVibrationState(long session, int controllerType, long outState)
      Unsafe version of: GetControllerVibrationState
    • ovr_GetControllerVibrationState

      public static int ovr_GetControllerVibrationState(long session, int controllerType, OVRHapticsPlaybackState outState)
      Gets the Haptics engine playback state of a specific Touch controller.
      Parameters:
      session - an ovrSession previously returned by Create
      controllerType - the controller where the Haptics buffer will be played
      outState - the state of the haptics engine
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_DeviceUnavailable: The call succeeded but the device referred to by controllerType is not available.
    • novr_TestBoundary

      public static int novr_TestBoundary(long session, int deviceBitmask, int boundaryType, long outTestResult)
      Unsafe version of: TestBoundary
    • ovr_TestBoundary

      public static int ovr_TestBoundary(long session, int deviceBitmask, int boundaryType, OVRBoundaryTestResult outTestResult)
      Tests collision/proximity of position tracked devices (e.g. HMD and/or Touch) against the Boundary System.

      Note: this method is similar to TestBoundaryPoint but can be more precise as it may take into account device acceleration/momentum.

      Parameters:
      session - an ovrSession previously returned by Create
      deviceBitmask - bitmask of one or more tracked devices to test. One or more of:
      TrackedDevice_NoneTrackedDevice_HMDTrackedDevice_LTouchTrackedDevice_RTouch
      TrackedDevice_TouchTrackedDevice_Object0TrackedDevice_Object1TrackedDevice_Object2
      TrackedDevice_Object3TrackedDevice_All
      boundaryType - the boundary type. One of:
      Boundary_OuterBoundary_PlayArea
      outTestResult - result of collision/proximity test, contains information such as distance and closest point
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
    • novr_TestBoundaryPoint

      public static int novr_TestBoundaryPoint(long session, long point, int singleBoundaryType, long outTestResult)
      Unsafe version of: TestBoundaryPoint
    • ovr_TestBoundaryPoint

      public static int ovr_TestBoundaryPoint(long session, OVRVector3f point, int singleBoundaryType, OVRBoundaryTestResult outTestResult)
      Tests collision/proximity of a 3D point against the Boundary System.
      Parameters:
      session - an ovrSession previously returned by Create
      point - the 3D point to test
      singleBoundaryType - the boundary type. One of:
      Boundary_OuterBoundary_PlayArea
      outTestResult - result of collision/proximity test, contains information such as distance and closest point
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
    • novr_SetBoundaryLookAndFeel

      public static int novr_SetBoundaryLookAndFeel(long session, long lookAndFeel)
      Unsafe version of: SetBoundaryLookAndFeel
    • ovr_SetBoundaryLookAndFeel

      public static int ovr_SetBoundaryLookAndFeel(long session, OVRBoundaryLookAndFeel lookAndFeel)
      Compatibility stub.

      Deprecated: previously set the look and feel of the Boundary System - this functionality has been removed.

      Parameters:
      session - an ovrSession previously returned by Create
      lookAndFeel - the look and feel parameters
      Returns:
      Success upon success
    • novr_ResetBoundaryLookAndFeel

      public static int novr_ResetBoundaryLookAndFeel(long session)
      Unsafe version of: ResetBoundaryLookAndFeel
    • ovr_ResetBoundaryLookAndFeel

      public static int ovr_ResetBoundaryLookAndFeel(long session)
      Resets the look and feel of the Boundary System to its default state.
      Parameters:
      session - an ovrSession previously returned by Create
      Returns:
      Success upon success
    • novr_GetBoundaryGeometry

      public static int novr_GetBoundaryGeometry(long session, int boundaryType, long outFloorPoints, long outFloorPointsCount)
      Unsafe version of: GetBoundaryGeometry
    • ovr_GetBoundaryGeometry

      public static int ovr_GetBoundaryGeometry(long session, int boundaryType, @Nullable OVRVector3f outFloorPoints, @Nullable IntBuffer outFloorPointsCount)
      Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points.
      Parameters:
      session - an ovrSession previously returned by Create
      boundaryType - the boundary type. One of:
      Boundary_OuterBoundary_PlayArea
      outFloorPoints - an array of 3D points (in clockwise order) defining the boundary at floor height (can be NULL to retrieve only the number of points)
      outFloorPointsCount - the number of 3D points returned in the array
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
    • novr_GetBoundaryDimensions

      public static int novr_GetBoundaryDimensions(long session, int boundaryType, long outDimensions)
      Unsafe version of: GetBoundaryDimensions
    • ovr_GetBoundaryDimensions

      public static int ovr_GetBoundaryDimensions(long session, int boundaryType, OVRVector3f outDimensions)
      Gets the dimension of the Boundary System's "play area" or "outer boundary".
      Parameters:
      session - an ovrSession previously returned by Create
      boundaryType - the boundary type. One of:
      Boundary_OuterBoundary_PlayArea
      outDimensions - dimensions of the axis aligned bounding box that encloses the area in meters (width, height and length)
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
    • novr_GetBoundaryVisible

      public static int novr_GetBoundaryVisible(long session, long outIsVisible)
      Unsafe version of: GetBoundaryVisible
    • ovr_GetBoundaryVisible

      public static int ovr_GetBoundaryVisible(long session, ByteBuffer outIsVisible)
      Returns if the boundary is currently visible.

      Note: visibility is false if the user has turned off boundaries, otherwise, it's true if the app has requested boundaries to be visible or if any tracked device is currently triggering it. This may not exactly match rendering due to fade-in and fade-out effects.

      Parameters:
      session - an ovrSession previously returned by Create
      outIsVisible - True, if the boundary is visible
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: The call succeeded and a result was returned.
      • Success_BoundaryInvalid: The call succeeded but the result is not a valid boundary due to not being set up.
    • novr_RequestBoundaryVisible

      public static int novr_RequestBoundaryVisible(long session, boolean visible)
      Unsafe version of: RequestBoundaryVisible
    • ovr_RequestBoundaryVisible

      public static int ovr_RequestBoundaryVisible(long session, boolean visible)
      Requests boundary to be visible.
      Parameters:
      session - an ovrSession previously returned by Create
      visible - forces the outer boundary to be visible. An application can't force it to be invisible, but can cancel its request by passing false.
      Returns:
      Success upon success
    • novr_GetExternalCameras

      public static int novr_GetExternalCameras(long session, long cameras, long inoutCameraCount)
      Unsafe version of: GetExternalCameras
      Parameters:
      inoutCameraCount - supply the array capacity, will return the actual \\# of cameras defined. If *inoutCameraCount is too small, will return Error_InsufficientArraySize.
    • ovr_GetExternalCameras

      public static int ovr_GetExternalCameras(long session, @Nullable OVRExternalCamera.Buffer cameras, IntBuffer inoutCameraCount)
      Returns the number of camera properties of all cameras
      Parameters:
      session - an ovrSession previously returned by Create
      cameras - pointer to the array. If null and the provided array capacity is sufficient, will return ovrError_NullArrayPointer.
      inoutCameraCount - supply the array capacity, will return the actual \\# of cameras defined. If *inoutCameraCount is too small, will return Error_InsufficientArraySize.
      Returns:
      the list of external cameras the system knows about. Returns Error_NoExternalCameraInfo if there is not any external camera information.
    • novr_SetExternalCameraProperties

      public static int novr_SetExternalCameraProperties(long session, long name, long intrinsics, long extrinsics)
      Unsafe version of: SetExternalCameraProperties
    • ovr_SetExternalCameraProperties

      public static int ovr_SetExternalCameraProperties(long session, ByteBuffer name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)
      Sets the camera intrinsics and/or extrinsics stored for the cameraName camera.

      Names must be < 32 characters and null-terminated.

      Parameters:
      session - an ovrSession previously returned by Create
      name - specifies which camera to set the intrinsics or extrinsics for. The name must be at most OVR_EXTERNAL_CAMERA_NAME_SIZE - 1 characters. Otherwise, Error_ExternalCameraNameWrongSize is returned.
      intrinsics - contains the intrinsic parameters to set, can be null
      extrinsics - ontains the extrinsic parameters to set, can be null
      Returns:
      Success or an ovrError code
    • ovr_SetExternalCameraProperties

      public static int ovr_SetExternalCameraProperties(long session, CharSequence name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)
      Sets the camera intrinsics and/or extrinsics stored for the cameraName camera.

      Names must be < 32 characters and null-terminated.

      Parameters:
      session - an ovrSession previously returned by Create
      name - specifies which camera to set the intrinsics or extrinsics for. The name must be at most OVR_EXTERNAL_CAMERA_NAME_SIZE - 1 characters. Otherwise, Error_ExternalCameraNameWrongSize is returned.
      intrinsics - contains the intrinsic parameters to set, can be null
      extrinsics - ontains the extrinsic parameters to set, can be null
      Returns:
      Success or an ovrError code
    • novr_GetTextureSwapChainLength

      public static int novr_GetTextureSwapChainLength(long session, long chain, long out_Length)
      Unsafe version of: GetTextureSwapChainLength
    • ovr_GetTextureSwapChainLength

      public static int ovr_GetTextureSwapChainLength(long session, long chain, IntBuffer out_Length)
      Gets the number of buffers in an ovrTextureSwapChain.
      Parameters:
      session - an ovrSession previously returned by Create
      chain - the ovrTextureSwapChain for which the length should be retrieved
      out_Length - returns the number of buffers in the specified chain
    • novr_GetTextureSwapChainCurrentIndex

      public static int novr_GetTextureSwapChainCurrentIndex(long session, long chain, long out_Index)
    • ovr_GetTextureSwapChainCurrentIndex

      public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, IntBuffer out_Index)
      Gets the current index in an ovrTextureSwapChain.
      Parameters:
      session - an ovrSession previously returned by Create
      chain - the ovrTextureSwapChain for which the index should be retrieved
      out_Index - returns the current (free) index in specified chain
    • novr_GetTextureSwapChainDesc

      public static int novr_GetTextureSwapChainDesc(long session, long chain, long out_Desc)
      Unsafe version of: GetTextureSwapChainDesc
    • ovr_GetTextureSwapChainDesc

      public static int ovr_GetTextureSwapChainDesc(long session, long chain, OVRTextureSwapChainDesc out_Desc)
      Gets the description of the buffers in an ovrTextureSwapChain.
      Parameters:
      session - an ovrSession previously returned by Create
      chain - the ovrTextureSwapChain for which the description should be retrieved
      out_Desc - returns the description of the specified chain
    • novr_CommitTextureSwapChain

      public static int novr_CommitTextureSwapChain(long session, long chain)
      Unsafe version of: CommitTextureSwapChain
    • ovr_CommitTextureSwapChain

      public static int ovr_CommitTextureSwapChain(long session, long chain)
      Commits any pending changes to an ovrTextureSwapChain, and advances its current index.

      When Commit is called, the texture at the current index is considered ready for use by the runtime, and further writes to it should be avoided. The swap chain's current index is advanced, providing there's room in the chain. The next time the SDK dereferences this texture swap chain, it will synchronize with the app's graphics context and pick up the submitted index, opening up room in the swap chain for further commits.

      Parameters:
      session - an ovrSession previously returned by Create
      chain - the ovrTextureSwapChain to commit
    • novr_DestroyTextureSwapChain

      public static void novr_DestroyTextureSwapChain(long session, long chain)
      Unsafe version of: DestroyTextureSwapChain
    • ovr_DestroyTextureSwapChain

      public static void ovr_DestroyTextureSwapChain(long session, long chain)
      Destroys an ovrTextureSwapChain and frees all the resources associated with it.
      Parameters:
      session - an ovrSession previously returned by Create
      chain - the ovrTextureSwapChain to destroy. If it is NULL then this function has no effect.
    • novr_DestroyMirrorTexture

      public static void novr_DestroyMirrorTexture(long session, long mirrorTexture)
      Unsafe version of: DestroyMirrorTexture
    • ovr_DestroyMirrorTexture

      public static void ovr_DestroyMirrorTexture(long session, long mirrorTexture)
      Destroys a mirror texture previously created by one of the mirror texture creation functions.
      Parameters:
      session - an ovrSession previously returned by Create
      mirrorTexture - the ovrTexture to destroy. If it is NULL then this function has no effect.
    • novr_GetFovTextureSize

      public static void novr_GetFovTextureSize(long session, int eye, long fov, float pixelsPerDisplayPixel, long __result)
      Unsafe version of: GetFovTextureSize
    • ovr_GetFovTextureSize

      public static OVRSizei ovr_GetFovTextureSize(long session, int eye, OVRFovPort fov, float pixelsPerDisplayPixel, OVRSizei __result)
      Calculates the recommended viewport size for rendering a given eye within the HMD with a given FOV cone.

      Higher FOV will generally require larger textures to maintain quality. Apps packing multiple eye views together on the same texture should ensure there are at least 8 pixels of padding between them to prevent texture filtering and chromatic aberration causing images to leak between the two eye views.

      Example code:

      
       ovrHmdDesc hmdDesc = ovr_GetHmdDesc(session);
       ovrSizei eyeSizeLeft  = ovr_GetFovTextureSize(session, ovrEye_Left,  hmdDesc.DefaultEyeFov[ovrEye_Left],  1.0f);
       ovrSizei eyeSizeRight = ovr_GetFovTextureSize(session, ovrEye_Right, hmdDesc.DefaultEyeFov[ovrEye_Right], 1.0f);
      Parameters:
      session - an ovrSession previously returned by Create
      eye - which eye (left or right) to calculate for. One of:
      Eye_LeftEye_Right
      fov - the OVRFovPort to use
      pixelsPerDisplayPixel - the ratio of the number of render target pixels to display pixels at the center of distortion. 1.0 is the default value. Lower values can improve performance, higher values give improved quality.
      __result - the texture width and height size
    • novr_GetRenderDesc

      public static void novr_GetRenderDesc(long session, int eyeType, long fov, long __result)
      Unsafe version of: GetRenderDesc
    • ovr_GetRenderDesc

      public static OVREyeRenderDesc ovr_GetRenderDesc(long session, int eyeType, OVRFovPort fov, OVREyeRenderDesc __result)
      Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.
      Parameters:
      session - an ovrSession previously returned by Create
      eyeType - which eye (left or right) for which to perform calculations. One of:
      Eye_LeftEye_Right
      fov - the OVRFovPort to use.
      __result - the computed OVREyeRenderDesc for the given eyeType and field of view
    • novr_GetFovStencil

      public static int novr_GetFovStencil(long session, long fovStencilDesc, long meshBuffer)
      Unsafe version of: GetFovStencil
    • ovr_GetFovStencil

      public static int ovr_GetFovStencil(long session, OVRFovStencilDesc fovStencilDesc, OVRFovStencilMeshBuffer meshBuffer)
      Returns a viewport stencil mesh to be used for defining the area or outline the user can see through the lens on an area defined by a given ovrFovPort.

      To find out how big the vertex and index buffers in meshBuffer buffer should be, first call this function setting AllocVertexCount & AllocIndexCount to 0 while also sending in nullptr for VertexBuffer & IndexBuffer. The SDK will populate UsedVertexCount & UsedIndexCount values.

      If Alloc*Count fields in meshBuffer are smaller than the expected Used*Count fields, (except when they are 0) then the SDK will return Error_InvalidParameter and leave VertexBuffer and IndexBuffer untouched.

      2D positions provided in the buffer will be in the [0,1] range where Y increases downward, similar to texture-UV space. If Y coordinates need to be flipped upside down, use the FovStencilFlag_MeshOriginAtBottomLeft.

      Parameters:
      session - an ovrSession previously returned by Create
      fovStencilDesc - info provided by caller necessary to generate a stencil mesh
      meshBuffer - mesh buffer to be partially filled in and returned by the SDK
      Returns:
      an ovrResult indicating success or failure. In the case of failure, use GetLastErrorInfo to get more information. Return values include but aren't limited to:
    • novr_WaitToBeginFrame

      public static int novr_WaitToBeginFrame(long session, long frameIndex)
      Unsafe version of: WaitToBeginFrame
    • ovr_WaitToBeginFrame

      public static int ovr_WaitToBeginFrame(long session, long frameIndex)
      Waits until surfaces are available and it is time to begin rendering the frame. Must be called before BeginFrame, but not necessarily from the same thread.
      Parameters:
      session - an ovrSession previously returned by Create
      frameIndex - specifies the targeted application frame index
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: command completed successfully.
      • Success_NotVisible: rendering of a previous frame completed successfully but was not displayed on the HMD, usually because another application currently has ownership of the HMD. Applications receiving this result should stop rendering new content and call GetSessionStatus to detect visibility.
      • Error_DisplayLost: The session has become invalid (such as due to a device removal) and the shared resources need to be released (DestroyTextureSwapChain), the session needs to destroyed (Destroy) and recreated (Create), and new resources need to be created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not need to be recreated unless the new ovr_Create call returns a different GraphicsLuid.
    • novr_BeginFrame

      public static int novr_BeginFrame(long session, long frameIndex)
      Unsafe version of: BeginFrame
    • ovr_BeginFrame

      public static int ovr_BeginFrame(long session, long frameIndex)
      Called from render thread before application begins rendering. Must be called after WaitToBeginFrame and before EndFrame, but not necessarily from the same threads.
      Parameters:
      session - an ovrSession previously returned by Create
      frameIndex - specifies the targeted application frame index. It must match what was passed to WaitToBeginFrame.
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: command completed successfully.
      • Error_DisplayLost: The session has become invalid (such as due to a device removal) and the shared resources need to be released (DestroyTextureSwapChain), the session needs to destroyed (Destroy) and recreated (Create), and new resources need to be created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not need to be recreated unless the new ovr_Create call returns a different GraphicsLuid.
    • novr_EndFrame

      public static int novr_EndFrame(long session, long frameIndex, long viewScaleDesc, long layerPtrList, int layerCount)
      Unsafe version of: EndFrame
      Parameters:
      layerCount - indicates the number of valid elements in layerPtrList. The maximum supported layerCount is not currently specified, but may be specified in a future version.
    • ovr_EndFrame

      public static int ovr_EndFrame(long session, long frameIndex, @Nullable OVRViewScaleDesc viewScaleDesc, PointerBuffer layerPtrList)
      Called from render thread after application has finished rendering. Must be called after BeginFrame, but not necessarily from the same thread. Submits layers for distortion and display, which will happen asynchronously.
      • Layers are drawn in the order they are specified in the array, regardless of the layer type.
      • Layers are not remembered between successive calls to EndFrame. A layer must be specified in every call to EndFrame or it won't be displayed.
      • If a layerPtrList entry that was specified in a previous call to EndFrame is passed as NULL or is of type LayerType_Disabled, that layer is no longer displayed.
      • A layerPtrList entry can be of any layer type and multiple entries of the same layer type are allowed. No layerPtrList entry may be duplicated (i.e. the same pointer as an earlier entry).

      Example code

      
       ovrLayerEyeFov  layer0;
       ovrLayerQuad    layer1;
       ...
       ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header };
       ovrResult result = ovr_EndFrame(session, frameIndex, nullptr, layers, 2);
      Parameters:
      session - an ovrSession previously returned by Create
      frameIndex - specifies the targeted application frame index. It must match what was passed to BeginFrame.
      viewScaleDesc - provides additional information needed only if layerPtrList contains an LayerType_Quad. If NULL, a default version is used based on the current configuration and a 1.0 world scale.
      layerPtrList - specifies a list of ovrLayer pointers, which can include NULL entries to indicate that any previously shown layer at that index is to not be displayed. Each layer header must be a part of a layer structure such as OVRLayerEyeFov or OVRLayerQuad, with Header.Type identifying its type. A NULL layerPtrList entry in the array indicates the absence of the given layer.
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:
      • Success: rendering completed successfully.
      • Error_DisplayLost: The session has become invalid (such as due to a device removal) and the shared resources need to be released (DestroyTextureSwapChain), the session needs to destroyed (Destroy) and recreated (Create), and new resources need to be created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not need to be recreated unless the new ovr_Create call returns a different GraphicsLuid.
      • Error_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or inconsistent state. Ensure CommitTextureSwapChain was called at least once first.
    • novr_SubmitFrame

      public static int novr_SubmitFrame(long session, long frameIndex, long viewScaleDesc, long layerPtrList, int layerCount)
      Unsafe version of: SubmitFrame
      Parameters:
      layerCount - the number of valid elements in layerPtrList. The maximum supported layerCount is not currently specified, but may be specified in a future version.
    • ovr_SubmitFrame

      public static int ovr_SubmitFrame(long session, long frameIndex, @Nullable OVRViewScaleDesc viewScaleDesc, PointerBuffer layerPtrList)
      Submits layers for distortion and display.

      Deprecated. Use WaitToBeginFrame(), BeginFrame(), and EndFrame instead.

      ovr_SubmitFrame triggers distortion and processing which might happen asynchronously. The function will return when there is room in the submission queue and surfaces are available. Distortion might or might not have completed.

      • Layers are drawn in the order they are specified in the array, regardless of the layer type.
      • Layers are not remembered between successive calls to ovr_SubmitFrame. A layer must be specified in every call to ovr_SubmitFrame or it won't be displayed.
      • If a layerPtrList entry that was specified in a previous call to ovr_SubmitFrame is passed as NULL or is of type LayerType_Disabled, that layer is no longer displayed.
      • A layerPtrList entry can be of any layer type and multiple entries of the same layer type are allowed. No layerPtrList entry may be duplicated (i.e. the same pointer as an earlier entry).

      Example code

      
       ovrLayerEyeFov  layer0;
       ovrLayerQuad    layer1;
       ...
       ovrLayerHeader* layers[2] = { &layer0.Header, &layer1.Header };
       ovrResult result = ovr_SubmitFrame(session, frameIndex, nullptr, layers, 2);
      Parameters:
      session - an ovrSession previously returned by Create
      frameIndex - the targeted application frame index, or 0 to refer to one frame after the last time SubmitFrame was called
      viewScaleDesc - provides additional information needed only if layerPtrList contains an LayerType_Quad. If NULL, a default version is used based on the current configuration and a 1.0 world scale.
      layerPtrList - a list of ovrLayer pointers, which can include NULL entries to indicate that any previously shown layer at that index is to not be displayed. Each layer header must be a part of a layer structure such as OVRLayerEyeFov or OVRLayerQuad, with Header.Type identifying its type. A NULL layerPtrList entry in the array indicates the absence of the given layer.
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon one of the possible success values:
      • Success: rendering completed successfully.
      • Success_NotVisible: rendering completed successfully but was not displayed on the HMD, usually because another application currently has ownership of the HMD. Applications receiving this result should stop rendering new content, call GetSessionStatus to detect visibility.
      • Error_DisplayLost: The session has become invalid (such as due to a device removal) and the shared resources need to be released (DestroyTextureSwapChain), the session needs to be destroyed (Destroy) and recreated (Create), and new resources need to be created (ovr_CreateTextureSwapChainXXX). The application's existing private graphics resources do not need to be recreated unless the new ovr_Create call returns a different GraphicsLuid.
      • Error_TextureSwapChainInvalid: The ovrTextureSwapChain is in an incomplete or inconsistent state. Ensure CommitTextureSwapChain was called at least once first.
    • novr_GetPerfStats

      public static int novr_GetPerfStats(long session, long outStats)
      Unsafe version of: GetPerfStats
    • ovr_GetPerfStats

      public static int ovr_GetPerfStats(long session, OVRPerfStats outStats)
      Retrieves performance stats for the VR app as well as the SDK compositor.

      This function will return stats for the VR app that is currently visible in the HMD regardless of what VR app is actually calling this function.

      If the VR app is trying to make sure the stats returned belong to the same application, the caller can compare the VisibleProcessId with their own process ID. Normally this will be the case if the caller is only calling ovr_GetPerfStats when GetSessionStatus has IsVisible flag set to be true.

      If the VR app calling ovr_GetPerfStats is actually the one visible in the HMD, then new perf stats will only be populated after a new call to SubmitFrame. That means subsequent calls to ovr_GetPerfStats after the first one without calling ovr_SubmitFrame will receive a FrameStatsCount of zero.

      If the VR app is not visible, or was initially marked as Init_Invisible, then each call to ovr_GetPerfStats will immediately fetch new perf stats from the compositor without a need for the ovr_SubmitFrame call.

      Even though invisible VR apps do not require ovr_SubmitFrame to be called to gather new perf stats, since stats are generated at the native refresh rate of the HMD (i.e. 90 Hz for CV1), calling it at a higher rate than that would be unnecessary.

      Parameters:
      session - an ovrSession previously returned by Create
      outStats - contains the performance stats for the application and SDK compositor
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success
    • novr_ResetPerfStats

      public static int novr_ResetPerfStats(long session)
      Unsafe version of: ResetPerfStats
    • ovr_ResetPerfStats

      public static int ovr_ResetPerfStats(long session)
      Resets the accumulated stats reported in each OVRPerfStatsPerCompositorFrame back to zero.

      Only the integer values such as HmdVsyncIndex, AppDroppedFrameCount etc. will be reset as the other fields such as AppMotionToPhotonLatency are independent timing values updated per-frame.

      Parameters:
      session - an ovrSession previously returned by Create
      Returns:
      an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success
    • novr_GetPredictedDisplayTime

      public static double novr_GetPredictedDisplayTime(long session, long frameIndex)
      Unsafe version of: GetPredictedDisplayTime
    • ovr_GetPredictedDisplayTime

      public static double ovr_GetPredictedDisplayTime(long session, long frameIndex)
      Gets the time of the specified frame midpoint.

      Predicts the time at which the given frame will be displayed. The predicted time is the middle of the time period during which the corresponding eye images will be displayed.

      The application should increment frameIndex for each successively targeted frame, and pass that index to any relevant OVR functions that need to apply to the frame identified by that index.

      This function is thread-safe and allows for multiple application threads to target their processing to the same displayed frame.

      In the event that prediction fails due to various reasons (e.g. the display being off or app has yet to present any frames), the return value will be current CPU time.

      Parameters:
      session - an ovrSession previously returned by Create
      frameIndex - the frame the caller wishes to target. A value of zero returns the next frame index.
      Returns:
      the absolute frame midpoint time for the given frameIndex
    • ovr_GetTimeInSeconds

      public static double ovr_GetTimeInSeconds()
      Returns global, absolute high-resolution time in seconds.

      The time frame of reference for this function is not specified and should not be depended upon.

      Returns:
      seconds as a floating point value
    • novr_GetBool

      public static boolean novr_GetBool(long session, long propertyName, boolean defaultVal)
      Unsafe version of: GetBool
    • ovr_GetBool

      public static boolean ovr_GetBool(long session, ByteBuffer propertyName, boolean defaultVal)
      Reads a boolean property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid for only the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the property interpreted as a boolean value. Returns defaultVal if the property doesn't exist.
    • ovr_GetBool

      public static boolean ovr_GetBool(long session, CharSequence propertyName, boolean defaultVal)
      Reads a boolean property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid for only the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the property interpreted as a boolean value. Returns defaultVal if the property doesn't exist.
    • novr_SetBool

      public static boolean novr_SetBool(long session, long propertyName, boolean value)
      Unsafe version of: SetBool
    • ovr_SetBool

      public static boolean ovr_SetBool(long session, ByteBuffer propertyName, boolean value)
      Writes or creates a boolean property.

      If the property wasn't previously a boolean property, it is changed to a boolean property.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the value to write
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • ovr_SetBool

      public static boolean ovr_SetBool(long session, CharSequence propertyName, boolean value)
      Writes or creates a boolean property.

      If the property wasn't previously a boolean property, it is changed to a boolean property.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the value to write
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • novr_GetInt

      public static int novr_GetInt(long session, long propertyName, int defaultVal)
      Unsafe version of: GetInt
    • ovr_GetInt

      public static int ovr_GetInt(long session, ByteBuffer propertyName, int defaultVal)
      Reads an integer property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the property interpreted as an integer value. Returns defaultVal if the property doesn't exist.
    • ovr_GetInt

      public static int ovr_GetInt(long session, CharSequence propertyName, int defaultVal)
      Reads an integer property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the property interpreted as an integer value. Returns defaultVal if the property doesn't exist.
    • novr_SetInt

      public static boolean novr_SetInt(long session, long propertyName, int value)
      Unsafe version of: SetInt
    • ovr_SetInt

      public static boolean ovr_SetInt(long session, ByteBuffer propertyName, int value)
      Writes or creates an integer property.

      If the property wasn't previously an integer property, it is changed to an integer property.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the value to write
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • ovr_SetInt

      public static boolean ovr_SetInt(long session, CharSequence propertyName, int value)
      Writes or creates an integer property.

      If the property wasn't previously an integer property, it is changed to an integer property.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the value to write
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • novr_GetFloat

      public static float novr_GetFloat(long session, long propertyName, float defaultVal)
      Unsafe version of: GetFloat
    • ovr_GetFloat

      public static float ovr_GetFloat(long session, ByteBuffer propertyName, float defaultVal)
      Reads a float property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the property interpreted as a float value. Returns defaultVal if the property doesn't exist.
    • ovr_GetFloat

      public static float ovr_GetFloat(long session, CharSequence propertyName, float defaultVal)
      Reads a float property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the property interpreted as a float value. Returns defaultVal if the property doesn't exist.
    • novr_SetFloat

      public static boolean novr_SetFloat(long session, long propertyName, float value)
      Unsafe version of: SetFloat
    • ovr_SetFloat

      public static boolean ovr_SetFloat(long session, ByteBuffer propertyName, float value)
      Writes or creates a float property.

      If the property wasn't previously a float property, it's changed to a float property.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the value to write
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • ovr_SetFloat

      public static boolean ovr_SetFloat(long session, CharSequence propertyName, float value)
      Writes or creates a float property.

      If the property wasn't previously a float property, it's changed to a float property.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the value to write
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • novr_GetFloatArray

      public static int novr_GetFloatArray(long session, long propertyName, long values, int valuesCapacity)
      Unsafe version of: GetFloatArray
      Parameters:
      valuesCapacity - the maximum number of elements to write to the values array
    • ovr_GetFloatArray

      public static int ovr_GetFloatArray(long session, ByteBuffer propertyName, FloatBuffer values)
      Reads a float array property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      values - an array of float to write to
      Returns:
      the number of elements read, or 0 if property doesn't exist or is empty
    • ovr_GetFloatArray

      public static int ovr_GetFloatArray(long session, CharSequence propertyName, FloatBuffer values)
      Reads a float array property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      values - an array of float to write to
      Returns:
      the number of elements read, or 0 if property doesn't exist or is empty
    • novr_SetFloatArray

      public static boolean novr_SetFloatArray(long session, long propertyName, long values, int valuesSize)
      Unsafe version of: SetFloatArray
      Parameters:
      valuesSize - the number of elements to write
    • ovr_SetFloatArray

      public static boolean ovr_SetFloatArray(long session, ByteBuffer propertyName, FloatBuffer values)
      Writes or creates a float array property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      values - an array of float to write from
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • ovr_SetFloatArray

      public static boolean ovr_SetFloatArray(long session, CharSequence propertyName, FloatBuffer values)
      Writes or creates a float array property.
      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      values - an array of float to write from
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • novr_GetString

      public static long novr_GetString(long session, long propertyName, long defaultVal)
      Unsafe version of: GetString
    • ovr_GetString

      @Nullable public static String ovr_GetString(long session, ByteBuffer propertyName, @Nullable ByteBuffer defaultVal)
      Reads a string property.

      Strings are UTF8-encoded and null-terminated.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the string property if it exists. Otherwise returns defaultVal, which can be specified as NULL. The return memory is guaranteed to be valid until next call to ovr_GetString or until the HMD is destroyed, whichever occurs first.
    • ovr_GetString

      @Nullable public static String ovr_GetString(long session, CharSequence propertyName, @Nullable CharSequence defaultVal)
      Reads a string property.

      Strings are UTF8-encoded and null-terminated.

      Parameters:
      session - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      defaultVal - specifes the value to return if the property couldn't be read
      Returns:
      the string property if it exists. Otherwise returns defaultVal, which can be specified as NULL. The return memory is guaranteed to be valid until next call to ovr_GetString or until the HMD is destroyed, whichever occurs first.
    • novr_SetString

      public static boolean novr_SetString(long hmddesc, long propertyName, long value)
      Unsafe version of: SetString
    • ovr_SetString

      public static boolean ovr_SetString(long hmddesc, ByteBuffer propertyName, ByteBuffer value)
      Writes or creates a string property.

      Strings are UTF8-encoded and null-terminated.

      Parameters:
      hmddesc - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the string property, which only needs to be valid for the duration of the call
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • ovr_SetString

      public static boolean ovr_SetString(long hmddesc, CharSequence propertyName, CharSequence value)
      Writes or creates a string property.

      Strings are UTF8-encoded and null-terminated.

      Parameters:
      hmddesc - an ovrSession previously returned by Create
      propertyName - the name of the property, which needs to be valid only for the call
      value - the string property, which only needs to be valid for the duration of the call
      Returns:
      true if successful, otherwise false. A false result should only occur if the property name is empty or if the property is read-only.
    • novr_GetDevicePoses

      public static int novr_GetDevicePoses(long session, int[] deviceTypes, int deviceCount, double absTime, long outDevicePoses)
    • ovr_GetDevicePoses

      public static int ovr_GetDevicePoses(long session, int[] deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)
      Array version of: GetDevicePoses
    • novr_GetBoundaryGeometry

      public static int novr_GetBoundaryGeometry(long session, int boundaryType, long outFloorPoints, int[] outFloorPointsCount)
    • ovr_GetBoundaryGeometry

      public static int ovr_GetBoundaryGeometry(long session, int boundaryType, @Nullable OVRVector3f outFloorPoints, @Nullable int[] outFloorPointsCount)
      Array version of: GetBoundaryGeometry
    • novr_GetExternalCameras

      public static int novr_GetExternalCameras(long session, long cameras, int[] inoutCameraCount)
    • ovr_GetExternalCameras

      public static int ovr_GetExternalCameras(long session, @Nullable OVRExternalCamera.Buffer cameras, int[] inoutCameraCount)
      Array version of: GetExternalCameras
    • novr_GetTextureSwapChainLength

      public static int novr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)
    • ovr_GetTextureSwapChainLength

      public static int ovr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)
      Array version of: GetTextureSwapChainLength
    • novr_GetTextureSwapChainCurrentIndex

      public static int novr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)
    • ovr_GetTextureSwapChainCurrentIndex

      public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)
    • novr_GetFloatArray

      public static int novr_GetFloatArray(long session, long propertyName, float[] values, int valuesCapacity)
    • ovr_GetFloatArray

      public static int ovr_GetFloatArray(long session, ByteBuffer propertyName, float[] values)
      Array version of: GetFloatArray
    • ovr_GetFloatArray

      public static int ovr_GetFloatArray(long session, CharSequence propertyName, float[] values)
      Array version of: GetFloatArray
    • novr_SetFloatArray

      public static boolean novr_SetFloatArray(long session, long propertyName, float[] values, int valuesSize)
    • ovr_SetFloatArray

      public static boolean ovr_SetFloatArray(long session, ByteBuffer propertyName, float[] values)
      Array version of: SetFloatArray
    • ovr_SetFloatArray

      public static boolean ovr_SetFloatArray(long session, CharSequence propertyName, float[] values)
      Array version of: SetFloatArray