Class OVR
- java.lang.Object
-
- org.lwjgl.ovr.OVR
-
public class OVR extends java.lang.Object
Native bindings to libOVR, using the Oculus SDK C API.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
novr_BeginFrame(long session, long frameIndex)
Unsafe version of:BeginFrame
static void
novr_ClearShouldRecenterFlag(long session)
Unsafe version of:ClearShouldRecenterFlag
static int
novr_CommitTextureSwapChain(long session, long chain)
Unsafe version of:CommitTextureSwapChain
static int
novr_Create(long pSession, long pLuid)
Unsafe version of:Create
static void
novr_Destroy(long session)
Unsafe version of:Destroy
static void
novr_DestroyMirrorTexture(long session, long mirrorTexture)
Unsafe version of:DestroyMirrorTexture
static void
novr_DestroyTextureSwapChain(long session, long chain)
Unsafe version of:DestroyTextureSwapChain
static int
novr_EnableExtension(long session, int extension)
Unsafe version of:EnableExtension
static int
novr_EndFrame(long session, long frameIndex, long viewScaleDesc, long layerPtrList, int layerCount)
Unsafe version of:EndFrame
static boolean
novr_GetBool(long session, long propertyName, boolean defaultVal)
Unsafe version of:GetBool
static int
novr_GetBoundaryDimensions(long session, int boundaryType, long outDimensions)
Unsafe version of:GetBoundaryDimensions
static int
novr_GetBoundaryGeometry(long session, int boundaryType, long outFloorPoints, int[] outFloorPointsCount)
Array version of:novr_GetBoundaryGeometry(long, int, long, long)
static int
novr_GetBoundaryGeometry(long session, int boundaryType, long outFloorPoints, long outFloorPointsCount)
Unsafe version of:GetBoundaryGeometry
static int
novr_GetBoundaryVisible(long session, long outIsVisible)
Unsafe version of:GetBoundaryVisible
static int
novr_GetConnectedControllerTypes(long session)
Unsafe version of:GetConnectedControllerTypes
static int
novr_GetControllerVibrationState(long session, int controllerType, long outState)
Unsafe version of:GetControllerVibrationState
static int
novr_GetDevicePoses(long session, int[] deviceTypes, int deviceCount, double absTime, long outDevicePoses)
Array version of:novr_GetDevicePoses(long, long, int, double, long)
static int
novr_GetDevicePoses(long session, long deviceTypes, int deviceCount, double absTime, long outDevicePoses)
Unsafe version of:GetDevicePoses
static int
novr_GetExternalCameras(long session, long cameras, int[] inoutCameraCount)
Array version of:novr_GetExternalCameras(long, long, long)
static int
novr_GetExternalCameras(long session, long cameras, long inoutCameraCount)
Unsafe version of:GetExternalCameras
static float
novr_GetFloat(long session, long propertyName, float defaultVal)
Unsafe version of:GetFloat
static int
novr_GetFloatArray(long session, long propertyName, float[] values, int valuesCapacity)
Array version of:novr_GetFloatArray(long, long, long, int)
static int
novr_GetFloatArray(long session, long propertyName, long values, int valuesCapacity)
Unsafe version of:GetFloatArray
static int
novr_GetFovStencil(long session, long fovStencilDesc, long meshBuffer)
Unsafe version of:GetFovStencil
static void
novr_GetFovTextureSize(long session, int eye, long fov, float pixelsPerDisplayPixel, long __result)
Unsafe version of:GetFovTextureSize
static void
novr_GetHmdDesc(long session, long __result)
Unsafe version of:GetHmdDesc
static int
novr_GetInputState(long session, int controllerType, long inputState)
Unsafe version of:GetInputState
static int
novr_GetInt(long session, long propertyName, int defaultVal)
Unsafe version of:GetInt
static void
novr_GetLastErrorInfo(long errorInfo)
Unsafe version of:GetLastErrorInfo
static int
novr_GetPerfStats(long session, long outStats)
Unsafe version of:GetPerfStats
static double
novr_GetPredictedDisplayTime(long session, long frameIndex)
Unsafe version of:GetPredictedDisplayTime
static void
novr_GetRenderDesc(long session, int eyeType, long fov, long __result)
Unsafe version of:GetRenderDesc
static int
novr_GetSessionStatus(long session, long sessionStatus)
Unsafe version of:GetSessionStatus
static long
novr_GetString(long session, long propertyName, long defaultVal)
Unsafe version of:GetString
static int
novr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)
Array version of:novr_GetTextureSwapChainCurrentIndex(long, long, long)
static int
novr_GetTextureSwapChainCurrentIndex(long session, long chain, long out_Index)
Unsafe version of:GetTextureSwapChainCurrentIndex
static int
novr_GetTextureSwapChainDesc(long session, long chain, long out_Desc)
Unsafe version of:GetTextureSwapChainDesc
static int
novr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)
Array version of:novr_GetTextureSwapChainLength(long, long, long)
static int
novr_GetTextureSwapChainLength(long session, long chain, long out_Length)
Unsafe version of:GetTextureSwapChainLength
static void
novr_GetTouchHapticsDesc(long session, int controllerType, long __result)
Unsafe version of:GetTouchHapticsDesc
static int
novr_GetTrackerCount(long session)
Unsafe version of:GetTrackerCount
static void
novr_GetTrackerDesc(long session, int trackerDescIndex, long __result)
Unsafe version of:GetTrackerDesc
static void
novr_GetTrackerPose(long session, int trackerPoseIndex, long __result)
Unsafe version of:GetTrackerPose
static int
novr_GetTrackingOriginType(long session)
Unsafe version of:GetTrackingOriginType
static void
novr_GetTrackingState(long session, double absTime, boolean latencyMarker, long __result)
Unsafe version of:GetTrackingState
static long
novr_GetVersionString()
Unsafe version of:GetVersionString
static int
novr_IdentifyClient(long identity)
Unsafe version of:IdentifyClient
static int
novr_Initialize(long params)
Unsafe version of:Initialize
static int
novr_IsExtensionSupported(long session, int extension, long outExtensionSupported)
Unsafe version of:IsExtensionSupported
static int
novr_RecenterTrackingOrigin(long session)
Unsafe version of:RecenterTrackingOrigin
static int
novr_RequestBoundaryVisible(long session, boolean visible)
Unsafe version of:RequestBoundaryVisible
static int
novr_ResetBoundaryLookAndFeel(long session)
Unsafe version of:ResetBoundaryLookAndFeel
static int
novr_ResetPerfStats(long session)
Unsafe version of:ResetPerfStats
static boolean
novr_SetBool(long session, long propertyName, boolean value)
Unsafe version of:SetBool
static int
novr_SetBoundaryLookAndFeel(long session, long lookAndFeel)
Unsafe version of:SetBoundaryLookAndFeel
static int
novr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)
Unsafe version of:SetControllerVibration
static int
novr_SetExternalCameraProperties(long session, long name, long intrinsics, long extrinsics)
Unsafe version of:SetExternalCameraProperties
static boolean
novr_SetFloat(long session, long propertyName, float value)
Unsafe version of:SetFloat
static boolean
novr_SetFloatArray(long session, long propertyName, float[] values, int valuesSize)
Array version of:novr_SetFloatArray(long, long, long, int)
static boolean
novr_SetFloatArray(long session, long propertyName, long values, int valuesSize)
Unsafe version of:SetFloatArray
static boolean
novr_SetInt(long session, long propertyName, int value)
Unsafe version of:SetInt
static boolean
novr_SetString(long hmddesc, long propertyName, long value)
Unsafe version of:SetString
static int
novr_SetTrackingOriginType(long session, int origin)
Unsafe version of:SetTrackingOriginType
static int
novr_SpecifyTrackingOrigin(long session, long originPose)
Unsafe version of:SpecifyTrackingOrigin
static int
novr_SubmitControllerVibration(long session, int controllerType, long buffer)
Unsafe version of:SubmitControllerVibration
static int
novr_SubmitFrame(long session, long frameIndex, long viewScaleDesc, long layerPtrList, int layerCount)
Unsafe version of:SubmitFrame
static int
novr_TestBoundary(long session, int deviceBitmask, int boundaryType, long outTestResult)
Unsafe version of:TestBoundary
static int
novr_TestBoundaryPoint(long session, long point, int singleBoundaryType, long outTestResult)
Unsafe version of:TestBoundaryPoint
static int
novr_TraceMessage(int level, long message)
Unsafe version of:TraceMessage
static int
novr_WaitToBeginFrame(long session, long frameIndex)
Unsafe version of:WaitToBeginFrame
static int
ovr_BeginFrame(long session, long frameIndex)
Called from render thread before application begins rendering.static void
ovr_ClearShouldRecenterFlag(long session)
Clears theShouldRecenter
status bit inOVRSessionStatus
.static int
ovr_CommitTextureSwapChain(long session, long chain)
Commits any pending changes to anovrTextureSwapChain
, and advances its current index.static int
ovr_Create(org.lwjgl.PointerBuffer pSession, OVRGraphicsLuid pLuid)
Creates a handle to a VR session.static void
ovr_Destroy(long session)
Destroys the session.static void
ovr_DestroyMirrorTexture(long session, long mirrorTexture)
Destroys a mirror texture previously created by one of the mirror texture creation functions.static void
ovr_DestroyTextureSwapChain(long session, long chain)
Destroys anovrTextureSwapChain
and frees all the resources associated with it.static int
ovr_EnableExtension(long session, int extension)
Enable extension.static int
ovr_EndFrame(long session, long frameIndex, OVRViewScaleDesc viewScaleDesc, org.lwjgl.PointerBuffer layerPtrList)
Called from render thread after application has finished rendering.static boolean
ovr_GetBool(long session, java.lang.CharSequence propertyName, boolean defaultVal)
Reads a boolean property.static boolean
ovr_GetBool(long session, java.nio.ByteBuffer propertyName, boolean defaultVal)
Reads a boolean property.static int
ovr_GetBoundaryDimensions(long session, int boundaryType, OVRVector3f outDimensions)
Gets the dimension of the Boundary System's "play area" or "outer boundary".static int
ovr_GetBoundaryGeometry(long session, int boundaryType, OVRVector3f outFloorPoints, int[] outFloorPointsCount)
Array version of:GetBoundaryGeometry
static int
ovr_GetBoundaryGeometry(long session, int boundaryType, OVRVector3f outFloorPoints, java.nio.IntBuffer outFloorPointsCount)
Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points.static int
ovr_GetBoundaryVisible(long session, java.nio.ByteBuffer outIsVisible)
Returns if the boundary is currently visible.static int
ovr_GetConnectedControllerTypes(long session)
Returns controller types connected to the system OR'ed together.static int
ovr_GetControllerVibrationState(long session, int controllerType, OVRHapticsPlaybackState outState)
Gets the Haptics engine playback state of a specific Touch controller.static int
ovr_GetDevicePoses(long session, int[] deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)
Array version of:GetDevicePoses
static int
ovr_GetDevicePoses(long session, java.nio.IntBuffer deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)
Returns an array of poses, where each pose matches a device type provided by thedeviceTypes
array parameter.static int
ovr_GetExternalCameras(long session, OVRExternalCamera.Buffer cameras, int[] inoutCameraCount)
Array version of:GetExternalCameras
static int
ovr_GetExternalCameras(long session, OVRExternalCamera.Buffer cameras, java.nio.IntBuffer inoutCameraCount)
Returns the number of camera properties of all camerasstatic float
ovr_GetFloat(long session, java.lang.CharSequence propertyName, float defaultVal)
Reads a float property.static float
ovr_GetFloat(long session, java.nio.ByteBuffer propertyName, float defaultVal)
Reads a float property.static int
ovr_GetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)
Array version of:GetFloatArray
static int
ovr_GetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)
Reads a float array property.static int
ovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)
Array version of:GetFloatArray
static int
ovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)
Reads a float array property.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 givenovrFovPort
.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.static OVRHmdDesc
ovr_GetHmdDesc(long session, OVRHmdDesc __result)
Returns information about the current HMD.static int
ovr_GetInputState(long session, int controllerType, OVRInputState inputState)
Returns the most recent input state for controllers, without positional tracking info.static int
ovr_GetInt(long session, java.lang.CharSequence propertyName, int defaultVal)
Reads an integer property.static int
ovr_GetInt(long session, java.nio.ByteBuffer propertyName, int defaultVal)
Reads an integer property.static void
ovr_GetLastErrorInfo(OVRErrorInfo errorInfo)
Returns information about the most recent failed return value by the current thread for this library.static int
ovr_GetPerfStats(long session, OVRPerfStats outStats)
Retrieves performance stats for the VR app as well as the SDK compositor.static double
ovr_GetPredictedDisplayTime(long session, long frameIndex)
Gets the time of the specified frame midpoint.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.static int
ovr_GetSessionStatus(long session, OVRSessionStatus sessionStatus)
Returns status information for the application.static java.lang.String
ovr_GetString(long session, java.lang.CharSequence propertyName, java.lang.CharSequence defaultVal)
Reads a string property.static java.lang.String
ovr_GetString(long session, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer defaultVal)
Reads a string property.static int
ovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)
Array version of:GetTextureSwapChainCurrentIndex
static int
ovr_GetTextureSwapChainCurrentIndex(long session, long chain, java.nio.IntBuffer out_Index)
Gets the current index in anovrTextureSwapChain
.static int
ovr_GetTextureSwapChainDesc(long session, long chain, OVRTextureSwapChainDesc out_Desc)
Gets the description of the buffers in anovrTextureSwapChain
.static int
ovr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)
Array version of:GetTextureSwapChainLength
static int
ovr_GetTextureSwapChainLength(long session, long chain, java.nio.IntBuffer out_Length)
Gets the number of buffers in anovrTextureSwapChain
.static double
ovr_GetTimeInSeconds()
Returns global, absolute high-resolution time in seconds.static OVRTouchHapticsDesc
ovr_GetTouchHapticsDesc(long session, int controllerType, OVRTouchHapticsDesc __result)
Gets information about Haptics engine for the specified Touch controller.static int
ovr_GetTrackerCount(long session)
Returns the number of attached trackers.static OVRTrackerDesc
ovr_GetTrackerDesc(long session, int trackerDescIndex, OVRTrackerDesc __result)
Returns a given attached tracker description.static OVRTrackerPose
ovr_GetTrackerPose(long session, int trackerPoseIndex, OVRTrackerPose __result)
Returns theOVRTrackerPose
for the given attached tracker.static int
ovr_GetTrackingOriginType(long session)
Gets the tracking origin state.static OVRTrackingState
ovr_GetTrackingState(long session, double absTime, boolean latencyMarker, OVRTrackingState __result)
Returns tracking state reading based on the specified absolute system time.static java.lang.String
ovr_GetVersionString()
Returns the version string representing the LibOVRRT version.static int
ovr_IdentifyClient(java.lang.CharSequence identity)
Identifies client application info.static int
ovr_IdentifyClient(java.nio.ByteBuffer identity)
Identifies client application info.static int
ovr_Initialize(OVRInitParams params)
Initialize LibOVR for application usage.static int
ovr_IsExtensionSupported(long session, int extension, java.nio.ByteBuffer outExtensionSupported)
Queries extension support status.static int
ovr_RecenterTrackingOrigin(long session)
Re-centers the sensor position and orientation.static int
ovr_RequestBoundaryVisible(long session, boolean visible)
Requests boundary to be visible.static int
ovr_ResetBoundaryLookAndFeel(long session)
Resets the look and feel of the Boundary System to its default state.static int
ovr_ResetPerfStats(long session)
Resets the accumulated stats reported in eachOVRPerfStatsPerCompositorFrame
back to zero.static boolean
ovr_SetBool(long session, java.lang.CharSequence propertyName, boolean value)
Writes or creates a boolean property.static boolean
ovr_SetBool(long session, java.nio.ByteBuffer propertyName, boolean value)
Writes or creates a boolean property.static int
ovr_SetBoundaryLookAndFeel(long session, OVRBoundaryLookAndFeel lookAndFeel)
Sets the look and feel of the Boundary System.static int
ovr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)
Sets constant vibration (with specified frequency and amplitude) to a controller.static int
ovr_SetExternalCameraProperties(long session, java.lang.CharSequence name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)
Sets the camera intrinsics and/or extrinsics stored for thecameraName
camera.static int
ovr_SetExternalCameraProperties(long session, java.nio.ByteBuffer name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)
Sets the camera intrinsics and/or extrinsics stored for thecameraName
camera.static boolean
ovr_SetFloat(long session, java.lang.CharSequence propertyName, float value)
Writes or creates a float property.static boolean
ovr_SetFloat(long session, java.nio.ByteBuffer propertyName, float value)
Writes or creates a float property.static boolean
ovr_SetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)
Array version of:SetFloatArray
static boolean
ovr_SetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)
Writes or creates a float array property.static boolean
ovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)
Array version of:SetFloatArray
static boolean
ovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)
Writes or creates a float array property.static boolean
ovr_SetInt(long session, java.lang.CharSequence propertyName, int value)
Writes or creates an integer property.static boolean
ovr_SetInt(long session, java.nio.ByteBuffer propertyName, int value)
Writes or creates an integer property.static boolean
ovr_SetString(long hmddesc, java.lang.CharSequence propertyName, java.lang.CharSequence value)
Writes or creates a string property.static boolean
ovr_SetString(long hmddesc, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer value)
Writes or creates a string property.static int
ovr_SetTrackingOriginType(long session, int origin)
Sets the tracking origin type.static void
ovr_Shutdown()
Shuts down LibOVR.static int
ovr_SpecifyTrackingOrigin(long session, OVRPosef originPose)
Allows manually tweaking the sensor position and orientation.static int
ovr_SubmitControllerVibration(long session, int controllerType, OVRHapticsBuffer buffer)
Submits a Haptics buffer (used for vibration) to Touch (only) controllers.static int
ovr_SubmitFrame(long session, long frameIndex, OVRViewScaleDesc viewScaleDesc, org.lwjgl.PointerBuffer layerPtrList)
Submits layers for distortion and display.static int
ovr_TestBoundary(long session, int deviceBitmask, int boundaryType, OVRBoundaryTestResult outTestResult)
Tests collision/proximity of position tracked devices (e.g.static int
ovr_TestBoundaryPoint(long session, OVRVector3f point, int singleBoundaryType, OVRBoundaryTestResult outTestResult)
Tests collision/proximity of a 3D point against the Boundary System.static int
ovr_TraceMessage(int level, java.lang.CharSequence message)
Writes a message string to the LibOVR tracing mechanism (if enabled).static int
ovr_TraceMessage(int level, java.nio.ByteBuffer message)
Writes a message string to the LibOVR tracing mechanism (if enabled).static int
ovr_WaitToBeginFrame(long session, long frameIndex)
Waits until surfaces are available and it is time to begin rendering the frame.
-
-
-
Field Detail
-
ovrInit_Debug, ovrInit_RequestVersion, ovrInit_Invisible, ovrInit_MixedRendering, ovrInit_FocusAware, ovrInit_WritableBits
Initialization flags. (ovrInitFlags
)Enum values:
Init_Debug
- When a debug library is requested, a slower debugging version of the library will run which can be used to help solve problems in the library and debug application code.Init_RequestVersion
- When a version is requested, the LibOVR runtime respects theRequestedMinorVersion
field and verifies that theRequestedMinorVersion
is supported.When a version is requested, the LibOVR runtime respects the
RequestedMinorVersion
field and verifies that theRequestedMinorVersion
is supported. Normally when you specify this flag you simply useMINOR_VERSION
forOVRInitParams
::RequestedMinorVersion
, though you could use a lower version thanMINOR_VERSION
to specify previous version behavior.Init_Invisible
- This client will not be visible in the HMD. Typically set by diagnostic or debugging utilities.Init_MixedRendering
- This client will alternate between VR and 2D rendering. Typically set by game engine editors and VR-enabled web browsers.Init_FocusAware
- This client is aware ofOVRSessionStatus
focus states (e.g.ovrSessionStatus::HasInputFocus
), and responds to them appropriately (e.g. pauses and stops drawing hands when lacking focus).Init_WritableBits
- These bits are writable by user code.
-
ovrLogLevel_Debug, ovrLogLevel_Info, ovrLogLevel_Error
Logging levels. (ovrLogLevel
)Enum values:
LogLevel_Debug
- Debug-level log event.LogLevel_Info
- Info-level log event.LogLevel_Error
- Error-level log event.
-
ovrHmd_None, ovrHmd_DK1, ovrHmd_DKHD, ovrHmd_DK2, ovrHmd_CB, ovrHmd_Other, ovrHmd_E3_2015, ovrHmd_ES06, ovrHmd_ES09, ovrHmd_ES11, ovrHmd_CV1, ovrHmd_RiftS
-
ovrHmdCap_DebugDevice
HMD capability bits reported by device. (ovrHmdCaps
)Enum values:
HmdCap_DebugDevice
- (read only) Specifies that the HMD is a virtual debug device.
-
ovrTrackingCap_Orientation, ovrTrackingCap_MagYawCorrection, ovrTrackingCap_Position
Tracking capability bits reported by the device. (ovrTrackingCaps
)Enum values:
TrackingCap_Orientation
- Supports orientation tracking (IMU).TrackingCap_MagYawCorrection
- Supports yaw drift correction.TrackingCap_Position
- Supports positional tracking.
-
ovrExtension_TextureLayout_Octilinear
Optional extensions. (ovrExtensions
)Enum values:
Extension_TextureLayout_Octilinear
- Enable before first layer submission.
-
ovrEye_Left, ovrEye_Right, ovrEye_Count
Specifies which eye is being used for rendering. (ovrEyeType
)This type explicitly does not include a third "NoStereo" monoscopic option, as such is not required for an HMD-centered API.
Enum values:
-
ovrTrackingOrigin_EyeLevel, ovrTrackingOrigin_FloorLevel
Specifies the coordinate system ovrTrackingState returns tracking poses in. (ovrTrackingOrigin
)Used with
SetTrackingOriginType
.Enum values:
TrackingOrigin_EyeLevel
- Tracking system origin reported at eye (HMD) height.Prefer using this origin when your application requires matching user's current physical head pose to a virtual head pose without any regards to a the height of the floor. Cockpit-based, or 3rd-person experiences are ideal candidates. When used, all poses in
OVRTrackingState
are reported as an offset transform from the profile calibrated or recentered HMD pose. It is recommended that apps using this origin type callRecenterTrackingOrigin
prior to starting the VR experience, but notify the user before doing so to make sure the user is in a comfortable pose, facing a comfortable direction.TrackingOrigin_FloorLevel
- Tracking system origin reported at floor height.Prefer using this origin when your application requires the physical floor height to match the virtual floor height, such as standing experiences. When used, all poses in
OVRTrackingState
are reported as an offset transform from the profile calibrated floor pose. CallingRecenterTrackingOrigin
will recenter the X & Z axes as well as yaw, but the Y-axis (i.e. height) will continue to be reported using the floor height as the origin for all poses.
-
ovrStatus_OrientationTracked, ovrStatus_PositionTracked, ovrStatus_OrientationValid, ovrStatus_PositionValid
Bit flags describing the current status of sensor tracking. (ovrStatusBits
Enum values:
Status_OrientationTracked
- Device orientation is currently tracked.It's possible that the device orientation is not tracked, but its reported orientation is nevertheless valid (e.g. due to estimation).
Status_PositionTracked
- Device position is currently tracked.It's possible that the device position is not tracked, but its reported position is nevertheless valid (e.g. due to estimation).
Status_OrientationValid
- The reported device orientation is valid for application use.In the case that
OrientationValid
is true andOrientationTracked
is false, the runtime may be estimating the orientation of the device. In the case thatOrientationValid
is false, the application should not use the returned orientation value.Status_PositionValid
- The reported device orientation is valid for application use.In the case that
PositionValid
is true andPositionTracked
is false, the runtime may be estimating the position of the device. In the case thatPositionValid
is false, the application should not use the returned position value.
-
ovrTracker_Connected, ovrTracker_PoseTracked
Specifies sensor flags. (ovrTrackerFlags
)Enum values:
Tracker_Connected
- The sensor is present, else the sensor is absent or offline.Tracker_PoseTracked
- The sensor has a valid pose, else the pose is unavailable. This will only be set if ovrTracker_Connected is set.
-
ovrTexture_2D, ovrTexture_2D_External, ovrTexture_Cube
The type of texture resource. (ovrTextureType
)Enum values:
Texture_2D
- 2D texturesTexture_2D_External
- Application-provided 2D texture. Not supported on PC.Texture_Cube
- Cube maps.OVRTextureSwapChainDesc
::ArraySize
must be 6 for this type.
-
ovrTextureBind_None, ovrTextureBind_DX_RenderTarget, ovrTextureBind_DX_UnorderedAccess, ovrTextureBind_DX_DepthStencil
The bindings required for texture swap chain. (ovrTextureBindFlags
)All texture swap chains are automatically bindable as shader input resources since the Oculus runtime needs this to read them.
Enum values:
TextureBind_None
TextureBind_DX_RenderTarget
- The application can write into the chain with pixel shaderTextureBind_DX_UnorderedAccess
- The application can write to the chain with compute shaderTextureBind_DX_DepthStencil
- The chain buffers can be bound as depth and/or stencil buffers. This flag cannot be combined withTextureBind_DX_RenderTarget
.
-
OVR_FORMAT_UNKNOWN, OVR_FORMAT_B5G6R5_UNORM, OVR_FORMAT_B5G5R5A1_UNORM, OVR_FORMAT_B4G4R4A4_UNORM, OVR_FORMAT_R8G8B8A8_UNORM, OVR_FORMAT_R8G8B8A8_UNORM_SRGB, OVR_FORMAT_B8G8R8A8_UNORM, OVR_FORMAT_B8G8R8_UNORM, OVR_FORMAT_B8G8R8A8_UNORM_SRGB, OVR_FORMAT_B8G8R8X8_UNORM, OVR_FORMAT_B8G8R8X8_UNORM_SRGB, OVR_FORMAT_R16G16B16A16_FLOAT, OVR_FORMAT_R11G11B10_FLOAT, OVR_FORMAT_D16_UNORM, OVR_FORMAT_D24_UNORM_S8_UINT, OVR_FORMAT_D32_FLOAT, OVR_FORMAT_D32_FLOAT_S8X24_UINT, OVR_FORMAT_BC1_UNORM, OVR_FORMAT_BC1_UNORM_SRGB, OVR_FORMAT_BC2_UNORM, OVR_FORMAT_BC2_UNORM_SRGB, OVR_FORMAT_BC3_UNORM, OVR_FORMAT_BC3_UNORM_SRGB, OVR_FORMAT_BC6H_UF16, OVR_FORMAT_BC6H_SF16, OVR_FORMAT_BC7_UNORM, OVR_FORMAT_BC7_UNORM_SRGB
The format of a texture. (ovrTextureFormat
)Enum values:
OVR_FORMAT_UNKNOWN
OVR_FORMAT_B5G6R5_UNORM
- Not currently supported on PC. Requires a DirectX 11.1 device.OVR_FORMAT_B5G5R5A1_UNORM
- Not currently supported on PC. Requires a DirectX 11.1 device.OVR_FORMAT_B4G4R4A4_UNORM
- Not currently supported on PC. Requires a DirectX 11.1 device.OVR_FORMAT_R8G8B8A8_UNORM
OVR_FORMAT_R8G8B8A8_UNORM_SRGB
OVR_FORMAT_B8G8R8A8_UNORM
OVR_FORMAT_B8G8R8_UNORM
OVR_FORMAT_B8G8R8A8_UNORM_SRGB
- Not supported for OpenGL applications.OVR_FORMAT_B8G8R8X8_UNORM
- Not supported for OpenGL applications.OVR_FORMAT_B8G8R8X8_UNORM_SRGB
- Not supported for OpenGL applications.OVR_FORMAT_R16G16B16A16_FLOAT
OVR_FORMAT_R11G11B10_FLOAT
- Not supported for D3D12 applications.OVR_FORMAT_D16_UNORM
OVR_FORMAT_D24_UNORM_S8_UINT
OVR_FORMAT_D32_FLOAT
OVR_FORMAT_D32_FLOAT_S8X24_UINT
OVR_FORMAT_BC1_UNORM
OVR_FORMAT_BC1_UNORM_SRGB
OVR_FORMAT_BC2_UNORM
OVR_FORMAT_BC2_UNORM_SRGB
OVR_FORMAT_BC3_UNORM
OVR_FORMAT_BC3_UNORM_SRGB
OVR_FORMAT_BC6H_UF16
OVR_FORMAT_BC6H_SF16
OVR_FORMAT_BC7_UNORM
OVR_FORMAT_BC7_UNORM_SRGB
-
ovrTextureMisc_None, ovrTextureMisc_DX_Typeless, ovrTextureMisc_AllowGenerateMips, ovrTextureMisc_ProtectedContent, ovrTextureMisc_AutoGenerateMips
Misc flags overriding particular behaviors of a texture swap chain. (ovrTextureFlags
)Enum values:
TextureMisc_None
TextureMisc_DX_Typeless
- DX only: The underlying texture is created with a TYPELESS equivalent of the format specified in the texture desc. The SDK will still access the texture using the format specified in the texture desc, but the app can create views with different formats if this is specified.TextureMisc_AllowGenerateMips
- DX only: Allow generation of the mip chain on the GPU via the GenerateMips call. This flag requires that RenderTarget binding also be specified.TextureMisc_ProtectedContent
- Texture swap chain contains protected content, and requires HDCP connection in order to display to HMD. Also prevents mirroring or other redirection of any frame containing this contentsTextureMisc_AutoGenerateMips
- Automatically generate and use the mip chain in composition on each submission. Mips are regenerated from highest quality level, ignoring other pre-existing mip levels.Not supported for depth or compressed (BC) formats.
-
ovrMirrorOption_Default, ovrMirrorOption_PostDistortion, ovrMirrorOption_LeftEyeOnly, ovrMirrorOption_RightEyeOnly, ovrMirrorOption_IncludeGuardian, ovrMirrorOption_IncludeNotifications, ovrMirrorOption_IncludeSystemGui, ovrMirrorOption_ForceSymmetricFov
Bit flags used as part ofOVRMirrorTextureDesc
'sMirrorOptions
field.ovrMirrorOptions
Enum values:
MirrorOption_Default
- By default the mirror texture will be:- Pre-distortion (i.e. rectilinear)
- Contain both eye textures
- Exclude Guardian, Notifications, System Menu GUI
MirrorOption_PostDistortion
- Retrieves the barrel distorted texture contents instead of the rectilinear one.This is only recommended for debugging purposes, and not for final desktop presentation.
MirrorOption_LeftEyeOnly
- SinceMirrorOption_Default
renders both eyes into the mirror texture, these two flags are exclusive (i.e. cannot use them simultaneously)MirrorOption_RightEyeOnly
- SeeMirrorOption_LeftEyeOnly
MirrorOption_IncludeGuardian
- Shows the boundary system aka Guardian on the mirror texture.MirrorOption_IncludeNotifications
- Shows system notifications the user receives on the mirror texture.MirrorOption_IncludeSystemGui
- Shows the system menu (triggered by hitting the Home button) on the mirror texture.MirrorOption_ForceSymmetricFov
- Forces mirror output to use max symmetric FOV instead of asymmetric full FOV used by HMD.Only valid for rectilinear mirrors i.e. using
MirrorOption_PostDistortion
withovrMirrorOption_ForceSymmetricFov
will result inError_InvalidParameter
error.
-
ovrFovStencil_HiddenArea, ovrFovStencil_VisibleArea, ovrFovStencil_BorderLine, ovrFovStencil_VisibleRectangle
Viewport stencil types provided by theGetFovStencil
call.ovrFovStencilType
Enum values:
FovStencil_HiddenArea
- Triangle list covering parts that are hidden to users.FovStencil_VisibleArea
- Triangle list covering parts that are visible to users.FovStencil_BorderLine
- Line list that draws the boundary visible to users.FovStencil_VisibleRectangle
- Axis-aligned rectangle fit in visible region. 4x vertices: TopLeft, TopRight, BottomRight, BottomLeft.
-
ovrFovStencilFlag_MeshOriginAtBottomLeft
Flags used byOVRFovStencilDesc
and which are passed toGetFovStencil
. (ovrFovStencilFlags
Enum values:
FovStencilFlag_MeshOriginAtBottomLeft
- When used, flips the Y component of the provided 2D mesh coordinates, such that Y increases upwards. When not used, places mesh origin at top-left where Y increases downwards.
-
ovrButton_A, ovrButton_B, ovrButton_RThumb, ovrButton_RShoulder, ovrButton_X, ovrButton_Y, ovrButton_LThumb, ovrButton_LShoulder, ovrButton_Up, ovrButton_Down, ovrButton_Left, ovrButton_Right, ovrButton_Enter, ovrButton_Back, ovrButton_VolUp, ovrButton_VolDown, ovrButton_Home, ovrButton_Private, ovrButton_RMask, ovrButton_LMask
Describes button input types.(ovrButton
)Button inputs are combined; that is they will be reported as pressed if they are pressed on either one of the two devices. The
ovrButton_Up/Down/Left/Right
map to both XBox D-Pad and directional buttons. TheovrButton_Enter
andovrButton_Return
map to Start and Back controller buttons, respectively.Enum values:
Button_A
- A button on XBox controllers and right Touch controller. Select button on Oculus Remote.Button_B
- B button on XBox controllers and right Touch controller. Back button on Oculus Remote.Button_RThumb
- Right thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.Button_RShoulder
- Right shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.Button_X
- X button on XBox controllers and left Touch controller. Not present on Oculus Remote.Button_Y
- Y button on XBox controllers and left Touch controller. Not present on Oculus Remote.Button_LThumb
- Left thumbstick on XBox controllers and Touch controllers. Not present on Oculus Remote.Button_LShoulder
- Left shoulder button on XBox controllers. Not present on Touch controllers or Oculus Remote.Button_Up
- Up button on XBox controllers and Oculus Remote. Not present on Touch controllers.Button_Down
- Down button on XBox controllers and Oculus Remote. Not present on Touch controllers.Button_Left
- Left button on XBox controllers and Oculus Remote. Not present on Touch controllers.Button_Right
- Right button on XBox controllers and Oculus Remote. Not present on Touch controllers.Button_Enter
- Start on XBox 360 controller. Menu on XBox One controller and Left Touch controller. Should be referred to as the Menu button in user-facing documentation.Button_Back
- Back on Xbox 360 controller. View button on XBox One controller. Not present on Touch controllers or Oculus Remote.Button_VolUp
- Volume button on Oculus Remote. Not present on XBox or Touch controllers.Button_VolDown
- Volume button on Oculus Remote. Not present on XBox or Touch controllers.Button_Home
- Home button on XBox controllers. Oculus button on Touch controllers and Oculus Remote.Button_Private
- Bit mask of all buttons that are for private usage by OculusButton_RMask
- Bit mask of all buttons on the right Touch controllerButton_LMask
- Bit mask of all buttons on the left Touch controller
-
ovrTouch_A, ovrTouch_B, ovrTouch_RThumb, ovrTouch_RThumbRest, ovrTouch_RIndexTrigger, ovrTouch_RButtonMask, ovrTouch_X, ovrTouch_Y, ovrTouch_LThumb, ovrTouch_LThumbRest, ovrTouch_LIndexTrigger, ovrTouch_LButtonMask, ovrTouch_RIndexPointing, ovrTouch_RThumbUp, ovrTouch_LIndexPointing, ovrTouch_LThumbUp, ovrTouch_RPoseMask, ovrTouch_LPoseMask
Describes touch input types. (ovrTouch
)These values map to capacitive touch values reported
OVRInputState
::Touch
. Some of these values are mapped to button bits for consistency.Enum values:
Touch_A
- Touch ATouch_B
- Touch BTouch_RThumb
- Touch RThumbTouch_RThumbRest
- Touch RThumbRestTouch_RIndexTrigger
- Touch RIndexTriggerTouch_RButtonMask
- Bit mask of all the button touches on the right controllerTouch_X
- Touch XTouch_Y
- Touch YTouch_LThumb
- Touch LThumbTouch_LThumbRest
- Touch LThumbRestTouch_LIndexTrigger
- Touch LIndexTriggerTouch_LButtonMask
- Bit mask of all the button touches on the left controllerTouch_RIndexPointing
- TouchRIndexPointingTouch_RThumbUp
- Touch RThumbUpTouch_LIndexPointing
- Touch LIndexPointingTouch_LThumbUp
- Touch LThumbUpTouch_RPoseMask
- Bit mask of all right controller posesTouch_LPoseMask
- Bit mask of all left controller poses.
-
ovrControllerType_None, ovrControllerType_LTouch, ovrControllerType_RTouch, ovrControllerType_Touch, ovrControllerType_Remote, ovrControllerType_XBox, ovrControllerType_Object0, ovrControllerType_Object1, ovrControllerType_Object2, ovrControllerType_Object3, ovrControllerType_Active
Which controller is connected; multiple can be connected at once. (ovrControllerType
)Enum values:
ControllerType_None
ControllerType_LTouch
ControllerType_RTouch
ControllerType_Touch
ControllerType_Remote
ControllerType_XBox
ControllerType_Object0
ControllerType_Object1
ControllerType_Object2
ControllerType_Object3
ControllerType_Active
- Operate on or query whichever controller is active.
-
ovrHapticsBufferSubmit_Enqueue
Haptics buffer submit mode. (ovrHapticsBufferSubmitMode
)Enum values:
HapticsBufferSubmit_Enqueue
- Enqueue buffer for later playback
-
ovrTrackedDevice_None, ovrTrackedDevice_HMD, ovrTrackedDevice_LTouch, ovrTrackedDevice_RTouch, ovrTrackedDevice_Touch, ovrTrackedDevice_Object0, ovrTrackedDevice_Object1, ovrTrackedDevice_Object2, ovrTrackedDevice_Object3, ovrTrackedDevice_All
Position tracked devices. (ovrTrackedDeviceType
)Enum values:
-
ovrCameraStatus_None, ovrCameraStatus_Connected, ovrCameraStatus_Calibrating, ovrCameraStatus_CalibrationFailed, ovrCameraStatus_Calibrated, ovrCameraStatus_Capturing
Camera status flags. (ovrCameraStatusFlags
)Enum values:
CameraStatus_None
- Initial state of camera.CameraStatus_Connected
- Bit set when the camera is connected to the system.CameraStatus_Calibrating
- Bit set when the camera is undergoing calibration.CameraStatus_CalibrationFailed
- Bit set when the camera has tried & failed calibration.CameraStatus_Calibrated
- Bit set when the camera has tried & passed calibration.CameraStatus_Capturing
- Bit set when the camera is capturing.
-
ovrBoundary_Outer, ovrBoundary_PlayArea
Boundary types that specified while using the boundary system. (ovrBoundaryType
)Enum values:
Boundary_Outer
- Outer boundary - closely represents user setup wallsBoundary_PlayArea
- Play area - safe rectangular area inside outer boundary which can optionally be used to restrict user interactions and motion.
-
ovrHand_Left, ovrHand_Right, ovrHand_Count
Names for the left and right hand array indexes. (ovrHandType
)Enum values:
-
ovrMaxProvidedFrameStats
Enum values:
MaxProvidedFrameStats
- Maximum number of frames of performance stats provided back to the caller ofGetPerfStats
.
-
OVR_HAPTICS_BUFFER_SAMPLES_MAX
Maximum number of samples inOVRHapticsBuffer
.
-
OVR_MAX_EXTERNAL_CAMERA_COUNT, OVR_EXTERNAL_CAMERA_NAME_SIZE
External camera constants
-
ovrMaxLayerCount
Specifies the maximum number of layers supported bySubmitFrame
.
-
ovrLayerType_Disabled, ovrLayerType_EyeFov, ovrLayerType_EyeFovDepth, ovrLayerType_Quad, ovrLayerType_EyeMatrix, ovrLayerType_EyeFovMultires, ovrLayerType_Cylinder, ovrLayerType_Cube
Describes layer types that can be passed toSubmitFrame
. (ovrLayerType
)Each layer type has an associated struct, such as
OVRLayerEyeFov
.Enum values:
LayerType_Disabled
- Layer is disabled.LayerType_EyeFov
- Described byOVRLayerEyeFov
.LayerType_EyeFovDepth
- Described byOVRLayerEyeFovDepth
.LayerType_Quad
- Described byOVRLayerQuad
.LayerType_EyeMatrix
- Described byOVRLayerEyeMatrix
.LayerType_EyeFovMultires
- Described byOVRLayerEyeFovMultires
.LayerType_Cylinder
- Described byOVRLayerCylinder
.LayerType_Cube
- Described byOVRLayerCube
.
-
ovrLayerFlag_HighQuality, ovrLayerFlag_TextureOriginAtBottomLeft, ovrLayerFlag_HeadLocked
Identifies flags used byOVRLayerHeader
and which are passed toSubmitFrame
. (ovrLayerFlags
)Enum values:
LayerFlag_HighQuality
- Enables 4x anisotropic sampling during the composition of the layer. The benefits are mostly visible at the periphery for high-frequency & high-contrast visuals. For best results consider combining this flag with anovrTextureSwapChain
that has mipmaps and instead of using arbitrary sized textures, prefer texture sizes that are powers-of-two. Actual rendered viewport and doesn't necessarily have to fill the whole texture.LayerFlag_TextureOriginAtBottomLeft
- the opposite is TopLeft. Generally this is false for D3D, true for OpenGL.LayerFlag_HeadLocked
- Mark this surface as "headlocked", which means it is specified relative to the HMD and moves with it, rather than being specified relative to sensor/torso space and remaining still while the head moves. What used to beovrLayerType_QuadHeadLocked
is nowLayerType_Quad
plus this flag. However the flag can be applied to any layer type to achieve a similar effect.
-
ovrTextureLayout_Rectilinear, ovrTextureLayout_Octilinear
Describes eye texture layouts. Used withOVRLayerEyeFovMultires
. (ovrTextureLayout
)Enum values:
TextureLayout_Rectilinear
- Regular eyeFov layer.TextureLayout_Octilinear
- Octilinear extension must be enabled.
-
ovrPerfHud_Off, ovrPerfHud_PerfSummary, ovrPerfHud_LatencyTiming, ovrPerfHud_AppRenderTiming, ovrPerfHud_CompRenderTiming, ovrPerfHud_AwsStats, ovrPerfHud_VersionInfo
Performance HUD enables the HMD user to see information critical to the real-time operation of the VR application such as latency timing, and CPU & GPU performance metrics.App can toggle performance HUD modes as such:
ovrPerfHudMode PerfHudMode = ovrPerfHud_LatencyTiming; ovr_SetInt(session, OVR_PERF_HUD_MODE, (int)PerfHudMode);
Enum values:
PerfHud_Off
- Turns off the performance HUDPerfHud_PerfSummary
- Shows performance summary and headroomPerfHud_LatencyTiming
- Shows latency related timing infoPerfHud_AppRenderTiming
- Shows render timing info for applicationPerfHud_CompRenderTiming
- Shows render timing info for OVR compositorPerfHud_AwsStats
- Shows Async Spacewarp-specific infoPerfHud_VersionInfo
- Shows SDK & HMD version Info
-
ovrLayerHud_Off, ovrLayerHud_Info
Layer HUD enables the HMD user to see information about a layer.App can toggle layer HUD modes as such:
ovrLayerHudMode LayerHudMode = ovrLayerHud_Info; ovr_SetInt(Hmd, OVR_LAYER_HUD_MODE, (int)LayerHudMode);
Enum values:
LayerHud_Off
- Turns off the layer HUDLayerHud_Info
- Shows info about a specific layer
-
ovrDebugHudStereo_Off, ovrDebugHudStereo_Quad, ovrDebugHudStereo_QuadWithCrosshair, ovrDebugHudStereo_CrosshairAtInfinity
Debug HUD is provided to help developers gauge and debug the fidelity of their app's stereo rendering characteristics. Using the provided quad and crosshair guides, the developer can verify various aspects such as VR tracking units (e.g. meters), stereo camera-parallax properties (e.g. making sure objects at infinity are rendered with the proper separation), measuring VR geometry sizes and distances and more.App can toggle the debug HUD modes as such:
ovrDebugHudStereoMode DebugHudMode = ovrDebugHudStereo_QuadWithCrosshair; ovr_SetInt(session, OVR_DEBUG_HUD_STEREO_MODE, (int)DebugHudMode);
The app can modify the visual properties of the stereo guide (i.e. quad, crosshair) using the
SetFloatArray
function. For a list of tweakable properties, see theOVR_DEBUG_HUD_STEREO_GUIDE_*
keys inOVRKeys
.Enum values:
DebugHudStereo_Off
- Turns off the Stereo Debug HUDDebugHudStereo_Quad
- Renders Quad in world for Stereo DebuggingDebugHudStereo_QuadWithCrosshair
- Renders Quad+crosshair in world for Stereo DebuggingDebugHudStereo_CrosshairAtInfinity
- Renders screen-space crosshair at infinity for Stereo Debugging
-
-
Method Detail
-
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 thanGetLastErrorInfo
and_Detect
, can be called unlessInitialize
succeeds. A successful call toovr_Initialize
must be eventually followed by a call toShutdown
.ovr_Initialize
calls are idempotent. Callingovr_Initialize
twice does not require two matching calls toovr_Shutdown
. If already initialized, the return value isSuccess
.LibOVRRT shared library search order:
- Current working directory (often the same as the application directory).
- Module directory (usually the same as the application directory, but not if the module is a separate shared library).
- Application directory
- Development directory (only if OVR_ENABLE_DEVELOPER_SEARCH is enabled, which is off by default).
- Standard OS shared library search location(s) (OS-specific).
- Parameters:
params
- specifies custom initialization options. May beNULL
to indicate default options when using the CAPI shim. If you are directly calling the LibOVRRT version ofovr_Initialize
in the LibOVRRT DLL then this must be valid and includeInit_RequestVersion
.- Returns:
- an
ovrResult
indicating success or failure. In the case of failure, useGetLastErrorInfo
to get more information. Example failed results include:Error_Initialize
: Generic initialization error.Error_LibLoad
: Couldn't load LibOVRRT.Error_LibVersion
: LibOVRRT version incompatibility.Error_ServiceConnection
: Couldn't connect to the OVR Service.Error_ServiceVersion
: OVR Service version incompatibility.Error_IncompatibleOS
: The operating system version is incompatible.Error_DisplayInit
: Unable to initialize the HMD display.Error_ServerStart
: Unable to start the server. Is it already running?Error_Reinitialization
: Attempted to re-initialize with a different version.
-
ovr_Shutdown
public static void ovr_Shutdown()
Shuts down LibOVR.A successful call to
Initialize
must be eventually matched by a call toovr_Shutdown
. After callingovr_Shutdown
, no LibOVR functions can be called exceptGetLastErrorInfo
or anotherInitialize
.ovr_Shutdown
invalidates all pointers, references, and created objects previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded byovr_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 failedovrResult
, with no other API functions called in the interim.- Parameters:
errorInfo
- The lastOVRErrorInfo
for the current thread
-
novr_GetVersionString
public static long novr_GetVersionString()
Unsafe version of:GetVersionString
-
ovr_GetVersionString
public static java.lang.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, java.nio.ByteBuffer message) public static int ovr_TraceMessage(int level, java.lang.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
- anovrLogLevel
constant. One of:LogLevel_Debug
LogLevel_Info
LogLevel_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(java.nio.ByteBuffer identity) public static int ovr_IdentifyClient(java.lang.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 toCreate
. 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_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, otherwiseovrHmdDesc::Type
will be set toHmd_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
asHmd_CV1
for backwards compatibility.- Parameters:
session
- anovrSession
previously returned byCreate
orNULL
__result
- anOVRHmdDesc
. If invoked withNULL
session argument,ovrHmdDesc::Type
toHmd_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
- anovrSession
previously returned byCreate
-
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 returnedtrackerDescArray
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
- anovrSession
previously returned byCreate
trackerDescIndex
- a tracker index. The valid indexes are in the range of 0 to the tracker count returned byGetTrackerCount
.__result
- anOVRTrackerDesc
. An emptyOVRTrackerDesc
will be returned iftrackerDescIndex
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(org.lwjgl.PointerBuffer pSession, OVRGraphicsLuid pLuid)
Creates a handle to a VR session.Upon success the returned
ovrSession
must be eventually freed withDestroy
when it is no longer needed. A second call toCreate
will result in an error return value if the previous session has not been destroyed.- Parameters:
pSession
- a pointer to anovrSession
which will be written to upon successpLuid
- 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 returnedovrSession
will beNULL
.
-
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
- anovrSession
previously returned byCreate
-
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
- anovrSession
previously returned byCreate
sessionStatus
- anOVRSessionStatus
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, java.nio.ByteBuffer outExtensionSupported)
Queries extension support status.- Parameters:
session
- anovrSession
previously returned byCreate
extension
- extension to queryoutExtensionSupported
- set to extension support status.True
if supported.- Returns:
- an
ovrResult
indicating success or failure. In the case of failure useGetLastErrorInfo
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 afterCreate
is called.- Parameters:
session
- anovrSession
previously returned byCreate
extension
- extension to enable.- Returns:
- an
ovrResult
indicating success or failure. Extension is only enabled if successful. In the case of failure useGetLastErrorInfo
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.
-
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
- anovrSession
previously returned byCreate
-
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 callGetTrackerPose
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 currentovrTrackingOrigin
setting.- Parameters:
session
- anovrSession
previously returned byCreate
-
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 callGetTrackerPose
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 currentovrTrackingOrigin
setting.- Parameters:
session
- anovrSession
previously returned byCreate
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 theShouldRecenter
status bit inOVRSessionStatus
.Clears the
ShouldRecenter
status bit inOVRSessionStatus
, allowing further recenter requests to be detected. Since this is automatically done byRecenterTrackingOrigin
andSpecifyTrackingOrigin
, this function only needs to be called when application is doing its own re-centering logic.- Parameters:
session
- anovrSession
previously returned byCreate
-
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 bothPredictedPose
andSamplePose
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
- anovrSession
previously returned byCreate
absTime
- the absolute future time to predict the returnOVRTrackingState
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 givenovrLayer
provides "SensorSampleTime", that will override the value stored here.__result
- theOVRTrackingState
that is predicted for the givenabsTime
-
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 theoutDevicePoses
anddeviceTypes
array.
-
ovr_GetDevicePoses
public static int ovr_GetDevicePoses(long session, java.nio.IntBuffer deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)
Returns an array of poses, where each pose matches a device type provided by thedeviceTypes
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
- anovrSession
previously returned byCreate
deviceTypes
- array of device types to query for their posesabsTime
- specifies the absolute future time to predict the returnovrTrackingState
value. Use 0 to request the most recent tracking state.outDevicePoses
- array of poses, one for each device type indeviceTypes
arrays- Returns:
- an
ovrResult
for whichOVR_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 theOVRTrackerPose
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
- anovrSession
previously returned byCreate
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 thePacketNumber
.
-
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
- anovrSession
previously returned byCreate
-
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
- anovrSession
previously returned byCreate
controllerType
- the controller to retrieve the information from__result
- anOVRTouchHapticsDesc
-
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 withSubmitControllerVibration
.This method should be called periodically, vibration lasts for a maximum of 2.5 seconds.
- Parameters:
session
- anovrSession
previously returned byCreate
controllerType
- the controller to set the vibration tofrequency
- 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 whichOVR_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 bycontrollerType
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 withSetControllerVibration
.- Parameters:
session
- anovrSession
previously returned byCreate
controllerType
- the controller where the Haptics buffer will be playedbuffer
- the Haptics buffer containing amplitude samples to be played- Returns:
- an
ovrResult
for whichOVR_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 bycontrollerType
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
- anovrSession
previously returned byCreate
controllerType
- the controller where the Haptics buffer will be playedoutState
- the state of the haptics engine- Returns:
- an
ovrResult
for whichOVR_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 bycontrollerType
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
- anovrSession
previously returned byCreate
deviceBitmask
- bitmask of one or more tracked devices to test. One or more of:TrackedDevice_None
TrackedDevice_HMD
TrackedDevice_LTouch
TrackedDevice_RTouch
TrackedDevice_Touch
TrackedDevice_Object0
TrackedDevice_Object1
TrackedDevice_Object2
TrackedDevice_Object3
TrackedDevice_All
boundaryType
- the boundary type. One of:Boundary_Outer
Boundary_PlayArea
outTestResult
- result of collision/proximity test, contains information such as distance and closest point- Returns:
- an
ovrResult
for whichOVR_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.Success_DeviceUnavailable
: The call succeeded but the device referred to bydeviceBitmask
is not available.
-
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
- anovrSession
previously returned byCreate
point
- the 3D point to testsingleBoundaryType
- the boundary type. One of:Boundary_Outer
Boundary_PlayArea
outTestResult
- result of collision/proximity test, contains information such as distance and closest point- Returns:
- an
ovrResult
for whichOVR_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)
Sets the look and feel of the Boundary System.
-
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.
-
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 java.nio.IntBuffer outFloorPointsCount)
Gets the geometry of the Boundary System's "play area" or "outer boundary" as 3D floor points.- Parameters:
session
- anovrSession
previously returned byCreate
boundaryType
- the boundary type. One of:Boundary_Outer
Boundary_PlayArea
outFloorPoints
- an array of 3D points (in clockwise order) defining the boundary at floor height (can beNULL
to retrieve only the number of points)outFloorPointsCount
- the number of 3D points returned in the array- Returns:
- an
ovrResult
for whichOVR_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
- anovrSession
previously returned byCreate
boundaryType
- the boundary type. One of:Boundary_Outer
Boundary_PlayArea
outDimensions
- dimensions of the axis aligned bounding box that encloses the area in meters (width, height and length)- Returns:
- an
ovrResult
for whichOVR_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, java.nio.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
- anovrSession
previously returned byCreate
outIsVisible
-True
, if the boundary is visible- Returns:
- an
ovrResult
for whichOVR_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.
-
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 returnError_InsufficientArraySize
.
-
ovr_GetExternalCameras
public static int ovr_GetExternalCameras(long session, @Nullable OVRExternalCamera.Buffer cameras, java.nio.IntBuffer inoutCameraCount)
Returns the number of camera properties of all cameras- Parameters:
session
- anovrSession
previously returned byCreate
cameras
- pointer to the array. If null and the provided array capacity is sufficient, will returnovrError_NullArrayPointer
.inoutCameraCount
- supply the array capacity, will return the actual \\# of cameras defined. If*inoutCameraCount
is too small, will returnError_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, java.nio.ByteBuffer name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics) public static int ovr_SetExternalCameraProperties(long session, java.lang.CharSequence name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)
Sets the camera intrinsics and/or extrinsics stored for thecameraName
camera.Names must be < 32 characters and null-terminated.
- Parameters:
session
- anovrSession
previously returned byCreate
name
- specifies which camera to set the intrinsics or extrinsics for. The name must be at mostOVR_EXTERNAL_CAMERA_NAME_SIZE
- 1 characters. Otherwise,Error_ExternalCameraNameWrongSize
is returned.intrinsics
- contains the intrinsic parameters to set, can be nullextrinsics
- ontains the extrinsic parameters to set, can be null- Returns:
Success
or anovrError
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, java.nio.IntBuffer out_Length)
Gets the number of buffers in anovrTextureSwapChain
.- Parameters:
session
- anovrSession
previously returned byCreate
chain
- theovrTextureSwapChain
for which the length should be retrievedout_Length
- returns the number of buffers in the specified chain
-
novr_GetTextureSwapChainCurrentIndex
public static int novr_GetTextureSwapChainCurrentIndex(long session, long chain, long out_Index)
Unsafe version of:GetTextureSwapChainCurrentIndex
-
ovr_GetTextureSwapChainCurrentIndex
public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, java.nio.IntBuffer out_Index)
Gets the current index in anovrTextureSwapChain
.- Parameters:
session
- anovrSession
previously returned byCreate
chain
- theovrTextureSwapChain
for which the index should be retrievedout_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 anovrTextureSwapChain
.- Parameters:
session
- anovrSession
previously returned byCreate
chain
- theovrTextureSwapChain
for which the description should be retrievedout_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 anovrTextureSwapChain
, 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
- anovrSession
previously returned byCreate
chain
- theovrTextureSwapChain
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 anovrTextureSwapChain
and frees all the resources associated with it.- Parameters:
session
- anovrSession
previously returned byCreate
chain
- theovrTextureSwapChain
to destroy. If it isNULL
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
- anovrSession
previously returned byCreate
mirrorTexture
- theovrTexture
to destroy. If it isNULL
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
- anovrSession
previously returned byCreate
eye
- which eye (left or right) to calculate for. One of:Eye_Left
Eye_Right
fov
- theOVRFovPort
to usepixelsPerDisplayPixel
- 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
- anovrSession
previously returned byCreate
eyeType
- which eye (left or right) for which to perform calculations. One of:Eye_Left
Eye_Right
fov
- theOVRFovPort
to use.__result
- the computedOVREyeRenderDesc
for the giveneyeType
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 givenovrFovPort
.To find out how big the vertex and index buffers in
meshBuffer
buffer should be, first call this function settingAllocVertexCount
&AllocIndexCount
to 0 while also sending innullptr
forVertexBuffer
&IndexBuffer
. The SDK will populateUsedVertexCount
&UsedIndexCount
values.If
Alloc*Count
fields inmeshBuffer
are smaller than the expectedUsed*Count
fields, (except when they are 0) then the SDK will returnError_InvalidParameter
and leaveVertexBuffer
andIndexBuffer
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 theFovStencilFlag_MeshOriginAtBottomLeft
.- Parameters:
session
- anovrSession
previously returned byCreate
fovStencilDesc
- info provided by caller necessary to generate a stencil meshmeshBuffer
- 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:Success
: Completed successfully.Error_ServiceConnection
: The service connection was lost and the application must destroy the session.Error_InvalidParameter
: One or more of the parameters
-
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 beforeBeginFrame
, but not necessarily from the same thread.- Parameters:
session
- anovrSession
previously returned byCreate
frameIndex
- specifies the targeted application frame index- Returns:
- an
ovrResult
for whichOVR_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 callGetSessionStatus
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 newovr_Create
call returns a differentGraphicsLuid
.
-
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 afterWaitToBeginFrame
and beforeEndFrame
, but not necessarily from the same threads.- Parameters:
session
- anovrSession
previously returned byCreate
frameIndex
- specifies the targeted application frame index. It must match what was passed toWaitToBeginFrame
.- Returns:
- an
ovrResult
for whichOVR_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 newovr_Create
call returns a differentGraphicsLuid
.
-
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 inlayerPtrList
. The maximum supportedlayerCount
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, org.lwjgl.PointerBuffer layerPtrList)
Called from render thread after application has finished rendering. Must be called afterBeginFrame
, 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
SubmitFrame
. A layer must be specified in every call toovr_SubmitFrame
or it won't be displayed. - If a
layerPtrList
entry that was specified in a previous call toSubmitFrame
is passed asNULL
or is of typeLayerType_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. NolayerPtrList
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
- anovrSession
previously returned byCreate
frameIndex
- specifies the targeted application frame index. It must match what was passed toBeginFrame
.viewScaleDesc
- provides additional information needed only iflayerPtrList
contains anLayerType_Quad
. IfNULL
, 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 includeNULL
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 asOVRLayerEyeFov
orOVRLayerQuad
, withHeader.Type
identifying its type. ANULL
layerPtrList entry in the array indicates the absence of the given layer.- Returns:
- an
ovrResult
for whichOVR_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 newovr_Create
call returns a differentGraphicsLuid
.Error_TextureSwapChainInvalid
: TheovrTextureSwapChain
is in an incomplete or inconsistent state. EnsureCommitTextureSwapChain
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 inlayerPtrList
. The maximum supportedlayerCount
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, org.lwjgl.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 toovr_SubmitFrame
or it won't be displayed. - If a
layerPtrList
entry that was specified in a previous call toovr_SubmitFrame
is passed asNULL
or is of typeLayerType_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. NolayerPtrList
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
- anovrSession
previously returned byCreate
frameIndex
- the targeted application frame index, or 0 to refer to one frame after the last timeSubmitFrame
was calledviewScaleDesc
- provides additional information needed only iflayerPtrList
contains anLayerType_Quad
. IfNULL
, a default version is used based on the current configuration and a 1.0 world scale.layerPtrList
- a list ofovrLayer
pointers, which can includeNULL
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 asOVRLayerEyeFov
orOVRLayerQuad
, withHeader.Type
identifying its type. ANULL
layerPtrList
entry in the array indicates the absence of the given layer.- Returns:
- an
ovrResult
for whichOVR_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, callGetSessionStatus
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 newovr_Create
call returns a differentGraphicsLuid
.Error_TextureSwapChainInvalid
: TheovrTextureSwapChain
is in an incomplete or inconsistent state. EnsureCommitTextureSwapChain
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 callingovr_GetPerfStats
whenGetSessionStatus
hasIsVisible
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 toSubmitFrame
. That means subsequent calls toovr_GetPerfStats
after the first one without callingovr_SubmitFrame
will receive aFrameStatsCount
of zero.If the VR app is not visible, or was initially marked as
Init_Invisible
, then each call toovr_GetPerfStats
will immediately fetch new perf stats from the compositor without a need for theovr_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
- anovrSession
previously returned byCreate
outStats
- contains the performance stats for the application and SDK compositor- Returns:
- an
ovrResult
for whichOVR_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 eachOVRPerfStatsPerCompositorFrame
back to zero.Only the integer values such as
HmdVsyncIndex
,AppDroppedFrameCount
etc. will be reset as the other fields such asAppMotionToPhotonLatency
are independent timing values updated per-frame.- Parameters:
session
- anovrSession
previously returned byCreate
- Returns:
- an
ovrResult
for whichOVR_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
- anovrSession
previously returned byCreate
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, java.nio.ByteBuffer propertyName, boolean defaultVal) public static boolean ovr_GetBool(long session, java.lang.CharSequence propertyName, boolean defaultVal)
Reads a boolean property.- Parameters:
session
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid for only the calldefaultVal
- 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, java.nio.ByteBuffer propertyName, boolean value) public static boolean ovr_SetBool(long session, java.lang.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
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the callvalue
- 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, java.nio.ByteBuffer propertyName, int defaultVal) public static int ovr_GetInt(long session, java.lang.CharSequence propertyName, int defaultVal)
Reads an integer property.- Parameters:
session
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the calldefaultVal
- 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, java.nio.ByteBuffer propertyName, int value) public static boolean ovr_SetInt(long session, java.lang.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
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the callvalue
- 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, java.nio.ByteBuffer propertyName, float defaultVal) public static float ovr_GetFloat(long session, java.lang.CharSequence propertyName, float defaultVal)
Reads a float property.- Parameters:
session
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the calldefaultVal
- 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, java.nio.ByteBuffer propertyName, float value) public static boolean ovr_SetFloat(long session, java.lang.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
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the callvalue
- 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, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values) public static int ovr_GetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)
Reads a float array property.- Parameters:
session
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the callvalues
- 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, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values) public static boolean ovr_SetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)
Writes or creates a float array property.- Parameters:
session
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the callvalues
- 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 java.lang.String ovr_GetString(long session, java.nio.ByteBuffer propertyName, @Nullable java.nio.ByteBuffer defaultVal) @Nullable public static java.lang.String ovr_GetString(long session, java.lang.CharSequence propertyName, @Nullable java.lang.CharSequence defaultVal)
Reads a string property.Strings are UTF8-encoded and null-terminated.
- Parameters:
session
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the calldefaultVal
- 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 asNULL
. The return memory is guaranteed to be valid until next call toovr_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, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer value) public static boolean ovr_SetString(long hmddesc, java.lang.CharSequence propertyName, java.lang.CharSequence value)
Writes or creates a string property.Strings are UTF8-encoded and null-terminated.
- Parameters:
hmddesc
- anovrSession
previously returned byCreate
propertyName
- the name of the property, which needs to be valid only for the callvalue
- 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)
Array version of:novr_GetDevicePoses(long, long, int, double, long)
-
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)
Array version of:novr_GetBoundaryGeometry(long, int, long, long)
-
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)
Array version of:novr_GetExternalCameras(long, long, long)
-
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)
Array version of:novr_GetTextureSwapChainLength(long, long, long)
-
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)
Array version of:novr_GetTextureSwapChainCurrentIndex(long, long, long)
-
ovr_GetTextureSwapChainCurrentIndex
public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)
Array version of:GetTextureSwapChainCurrentIndex
-
novr_GetFloatArray
public static int novr_GetFloatArray(long session, long propertyName, float[] values, int valuesCapacity)
Array version of:novr_GetFloatArray(long, long, long, int)
-
ovr_GetFloatArray
public static int ovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values) public static int ovr_GetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)
Array version of:GetFloatArray
-
novr_SetFloatArray
public static boolean novr_SetFloatArray(long session, long propertyName, float[] values, int valuesSize)
Array version of:novr_SetFloatArray(long, long, long, int)
-
ovr_SetFloatArray
public static boolean ovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values) public static boolean ovr_SetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)
Array version of:SetFloatArray
-
-