Class OVR
- java.lang.Object
-
- org.lwjgl.ovr.OVR
-
public class OVR extends java.lang.ObjectNative bindings to libOVR, using the Oculus SDK C API.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intovr_BeginFrame(long session, long frameIndex)Called from render thread before application begins rendering.static voidovr_ClearShouldRecenterFlag(long session)Clears theShouldRecenterstatus bit inOVRSessionStatus.static intovr_CommitTextureSwapChain(long session, long chain)Commits any pending changes to anovrTextureSwapChain, and advances its current index.static intovr_Create(org.lwjgl.PointerBuffer pSession, OVRGraphicsLuid pLuid)Creates a handle to a VR session.static voidovr_Destroy(long session)Destroys the session.static voidovr_DestroyMirrorTexture(long session, long mirrorTexture)Destroys a mirror texture previously created by one of the mirror texture creation functions.static voidovr_DestroyTextureSwapChain(long session, long chain)Destroys anovrTextureSwapChainand frees all the resources associated with it.static intovr_EnableExtension(long session, int extension)Enable extension.static intovr_EndFrame(long session, long frameIndex, OVRViewScaleDesc viewScaleDesc, org.lwjgl.PointerBuffer layerPtrList)Called from render thread after application has finished rendering.static booleanovr_GetBool(long session, java.nio.ByteBuffer propertyName, boolean defaultVal)Reads a boolean property.static booleanovr_GetBool(long session, java.lang.CharSequence propertyName, boolean defaultVal)Reads a boolean property.static intovr_GetBoundaryDimensions(long session, int boundaryType, OVRVector3f outDimensions)Gets the dimension of the Boundary System's "play area" or "outer boundary".static intovr_GetBoundaryGeometry(long session, int boundaryType, OVRVector3f outFloorPoints, int[] outFloorPointsCount)Array version of:GetBoundaryGeometrystatic intovr_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 intovr_GetBoundaryVisible(long session, java.nio.ByteBuffer outIsVisible)Returns if the boundary is currently visible.static intovr_GetConnectedControllerTypes(long session)Returns controller types connected to the system OR'ed together.static intovr_GetControllerVibrationState(long session, int controllerType, OVRHapticsPlaybackState outState)Gets the Haptics engine playback state of a specific Touch controller.static intovr_GetDevicePoses(long session, int[] deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)Array version of:GetDevicePosesstatic intovr_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 thedeviceTypesarray parameter.static intovr_GetExternalCameras(long session, OVRExternalCamera.Buffer cameras, int[] inoutCameraCount)Array version of:GetExternalCamerasstatic intovr_GetExternalCameras(long session, OVRExternalCamera.Buffer cameras, java.nio.IntBuffer inoutCameraCount)Returns the number of camera properties of all cameras.static floatovr_GetFloat(long session, java.nio.ByteBuffer propertyName, float defaultVal)Reads a float property.static floatovr_GetFloat(long session, java.lang.CharSequence propertyName, float defaultVal)Reads a float property.static intovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)Array version of:GetFloatArraystatic intovr_GetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)Reads a float array property.static intovr_GetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)Array version of:GetFloatArraystatic intovr_GetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)Reads a float array property.static OVRSizeiovr_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 OVRHmdDescovr_GetHmdDesc(long session, OVRHmdDesc __result)Returns information about the current HMD.static intovr_GetInputState(long session, int controllerType, OVRInputState inputState)Returns the most recent input state for controllers, without positional tracking info.static intovr_GetInt(long session, java.nio.ByteBuffer propertyName, int defaultVal)Reads an integer property.static intovr_GetInt(long session, java.lang.CharSequence propertyName, int defaultVal)Reads an integer property.static voidovr_GetLastErrorInfo(OVRErrorInfo errorInfo)Returns information about the most recent failed return value by the current thread for this library.static intovr_GetPerfStats(long session, OVRPerfStats outStats)Retrieves performance stats for the VR app as well as the SDK compositor.static doubleovr_GetPredictedDisplayTime(long session, long frameIndex)Gets the time of the specified frame midpoint.static OVREyeRenderDescovr_GetRenderDesc(long session, int eyeType, OVRFovPort fov, OVREyeRenderDesc __result)Computes the distortion viewport, view adjust, and other rendering parameters for the specified eye.static intovr_GetSessionStatus(long session, OVRSessionStatus sessionStatus)Returns status information for the application.static java.lang.Stringovr_GetString(long session, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer defaultVal)Reads a string property.static java.lang.Stringovr_GetString(long session, java.lang.CharSequence propertyName, java.lang.CharSequence defaultVal)Reads a string property.static intovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)Array version of:GetTextureSwapChainCurrentIndexstatic intovr_GetTextureSwapChainCurrentIndex(long session, long chain, java.nio.IntBuffer out_Index)Gets the current index in anovrTextureSwapChain.static intovr_GetTextureSwapChainDesc(long session, long chain, OVRTextureSwapChainDesc out_Desc)Gets the description of the buffers in anovrTextureSwapChain.static intovr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)Array version of:GetTextureSwapChainLengthstatic intovr_GetTextureSwapChainLength(long session, long chain, java.nio.IntBuffer out_Length)Gets the number of buffers in anovrTextureSwapChain.static doubleovr_GetTimeInSeconds()Returns global, absolute high-resolution time in seconds.static OVRTouchHapticsDescovr_GetTouchHapticsDesc(long session, int controllerType, OVRTouchHapticsDesc __result)Gets information about Haptics engine for the specified Touch controller.static intovr_GetTrackerCount(long session)Returns the number of attached trackers.static OVRTrackerDescovr_GetTrackerDesc(long session, int trackerDescIndex, OVRTrackerDesc __result)Returns a given attached tracker description.static OVRTrackerPoseovr_GetTrackerPose(long session, int trackerPoseIndex, OVRTrackerPose __result)Returns theOVRTrackerPosefor the given attached tracker.static intovr_GetTrackingOriginType(long session)Gets the tracking origin state.static OVRTrackingStateovr_GetTrackingState(long session, double absTime, boolean latencyMarker, OVRTrackingState __result)Returns tracking state reading based on the specified absolute system time.static java.lang.Stringovr_GetVersionString()Returns the version string representing the LibOVRRT version.static intovr_IdentifyClient(java.nio.ByteBuffer identity)Identifies client application info.static intovr_IdentifyClient(java.lang.CharSequence identity)Identifies client application info.static intovr_Initialize(OVRInitParams params)Initialize LibOVR for application usage.static intovr_IsExtensionSupported(long session, int extension, java.nio.ByteBuffer outExtensionSupported)Queries extension support status.static intovr_RecenterTrackingOrigin(long session)Re-centers the sensor position and orientation.static intovr_RequestBoundaryVisible(long session, boolean visible)Requests boundary to be visible.static intovr_ResetBoundaryLookAndFeel(long session)Resets the look and feel of the Boundary System to its default state.static intovr_ResetPerfStats(long session)Resets the accumulated stats reported in eachOVRPerfStatsPerCompositorFrameback to zero.static booleanovr_SetBool(long session, java.nio.ByteBuffer propertyName, boolean value)Writes or creates a boolean property.static booleanovr_SetBool(long session, java.lang.CharSequence propertyName, boolean value)Writes or creates a boolean property.static intovr_SetBoundaryLookAndFeel(long session, OVRBoundaryLookAndFeel lookAndFeel)Sets the look and feel of the Boundary System.static intovr_SetControllerVibration(long session, int controllerType, float frequency, float amplitude)Sets constant vibration (with specified frequency and amplitude) to a controller.static intovr_SetExternalCameraProperties(long session, java.nio.ByteBuffer name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)Sets the camera intrinsics and/or extrinsics stored for thenamecamera.static intovr_SetExternalCameraProperties(long session, java.lang.CharSequence name, OVRCameraIntrinsics intrinsics, OVRCameraExtrinsics extrinsics)Sets the camera intrinsics and/or extrinsics stored for thenamecamera.static booleanovr_SetFloat(long session, java.nio.ByteBuffer propertyName, float value)Writes or creates a float property.static booleanovr_SetFloat(long session, java.lang.CharSequence propertyName, float value)Writes or creates a float property.static booleanovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, float[] values)Array version of:SetFloatArraystatic booleanovr_SetFloatArray(long session, java.nio.ByteBuffer propertyName, java.nio.FloatBuffer values)Writes or creates a float array property.static booleanovr_SetFloatArray(long session, java.lang.CharSequence propertyName, float[] values)Array version of:SetFloatArraystatic booleanovr_SetFloatArray(long session, java.lang.CharSequence propertyName, java.nio.FloatBuffer values)Writes or creates a float array property.static booleanovr_SetInt(long session, java.nio.ByteBuffer propertyName, int value)Writes or creates an integer property.static booleanovr_SetInt(long session, java.lang.CharSequence propertyName, int value)Writes or creates an integer property.static booleanovr_SetString(long hmddesc, java.nio.ByteBuffer propertyName, java.nio.ByteBuffer value)Writes or creates a string property.static booleanovr_SetString(long hmddesc, java.lang.CharSequence propertyName, java.lang.CharSequence value)Writes or creates a string property.static intovr_SetTrackingOriginType(long session, int origin)Sets the tracking origin type.static voidovr_Shutdown()Shuts down LibOVR.static intovr_SpecifyTrackingOrigin(long session, OVRPosef originPose)Allows manually tweaking the sensor position and orientation.static intovr_SubmitControllerVibration(long session, int controllerType, OVRHapticsBuffer buffer)Submits a Haptics buffer (used for vibration) to Touch (only) controllers.static intovr_SubmitFrame(long session, long frameIndex, OVRViewScaleDesc viewScaleDesc, org.lwjgl.PointerBuffer layerPtrList)Submits layers for distortion and display.static intovr_TestBoundary(long session, int deviceBitmask, int boundaryType, OVRBoundaryTestResult outTestResult)Tests collision/proximity of position tracked devices (e.g.static intovr_TestBoundaryPoint(long session, OVRVector3f point, int singleBoundaryType, OVRBoundaryTestResult outTestResult)Tests collision/proximity of a 3D point against the Boundary System.static intovr_TraceMessage(int level, java.nio.ByteBuffer message)Writes a message string to the LibOVR tracing mechanism (if enabled).static intovr_TraceMessage(int level, java.lang.CharSequence message)Writes a message string to the LibOVR tracing mechanism (if enabled).static intovr_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 theRequestedMinorVersionfield and verifies that theRequestedMinorVersionis supported.When a version is requested, the LibOVR runtime respects the
RequestedMinorVersionfield and verifies that theRequestedMinorVersionis supported. Normally when you specify this flag you simply useMINOR_VERSIONforOVRInitParams::RequestedMinorVersion, though you could use a lower version thanMINOR_VERSIONto 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 ofOVRSessionStatusfocus 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
-
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
OVRTrackingStateare reported as an offset transform from the profile calibrated or recentered HMD pose. It is recommended that apps using this origin type callRecenterTrackingOriginprior 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
OVRTrackingStateare reported as an offset transform from the profile calibrated floor pose. CallingRecenterTrackingOriginwill 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
Bit flags describing the current status of sensor tracking. (ovrStatusBitsEnum values:
Status_OrientationTracked- Orientation is currently tracked (connected and in use).Status_PositionTracked- Position is currently tracked (false if out of range).
-
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::ArraySizemust 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_NoneTextureBind_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_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_UNKNOWNOVR_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_UNORMOVR_FORMAT_R8G8B8A8_UNORM_SRGBOVR_FORMAT_B8G8R8A8_UNORMOVR_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_FLOATOVR_FORMAT_R11G11B10_FLOATOVR_FORMAT_D16_UNORMOVR_FORMAT_D24_UNORM_S8_UINTOVR_FORMAT_D32_FLOATOVR_FORMAT_D32_FLOAT_S8X24_UINTOVR_FORMAT_BC1_UNORMOVR_FORMAT_BC1_UNORM_SRGBOVR_FORMAT_BC2_UNORMOVR_FORMAT_BC2_UNORM_SRGBOVR_FORMAT_BC3_UNORMOVR_FORMAT_BC3_UNORM_SRGBOVR_FORMAT_BC6H_UF16OVR_FORMAT_BC6H_SF16OVR_FORMAT_BC7_UNORMOVR_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_NoneTextureMisc_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
Bit flags used as part ofOVRMirrorTextureDesc'sMirrorOptionsfield.ovrMirrorOptionsEnum 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_Defaultrenders both eyes into the mirror texture, these two flags are exclusive (i.e. cannot use them simultaneously)MirrorOption_RightEyeOnly- SeeMirrorOption_LeftEyeOnlyMirrorOption_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.
-
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
Button input types. (ovrTouch)Enum values:
Button_A- Button AButton_B- Button BButton_RThumb- Button RThumbButton_RShoulder- Button RShoulderButton_X- Button XButton_Y- Button YButton_LThumb- Button LThumbButton_LShoulder- Button LShoulderButton_Up- Button UpButton_Down- Button DownButton_Left- Button LeftButton_Right- Button RightButton_Enter- Button EnterButton_Back- Button BackButton_VolUp- Button VolUpButton_VolDown- Button VolDownButton_Home- Button HomeButton_PrivateButton_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
Touch input types.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_NoneControllerType_LTouchControllerType_RTouchControllerType_TouchControllerType_RemoteControllerType_XBoxControllerType_Object0ControllerType_Object1ControllerType_Object2ControllerType_Object3ControllerType_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
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.
-
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.
-
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 byOVRLayerHeaderand 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 anovrTextureSwapChainthat 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_QuadHeadLockedis nowLayerType_Quadplus 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
SetFloatArrayfunction. 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
-
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 thanGetLastErrorInfoand_Detect, can be called unlessInitializesucceeds. A successful call toovr_Initializemust be eventually followed by a call toShutdown.ovr_Initializecalls are idempotent. Callingovr_Initializetwice 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 beNULLto indicate default options when using the CAPI shim. If you are directly calling the LibOVRRT version ofovr_Initializein the LibOVRRT DLL then this must be valid and includeInit_RequestVersion.- Returns:
- an
ovrResultindicating success or failure. In the case of failure, useGetLastErrorInfoto 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
Initializemust be eventually matched by a call toovr_Shutdown. After callingovr_Shutdown, no LibOVR functions can be called exceptGetLastErrorInfoor anotherInitialize.ovr_Shutdowninvalidates all pointers, references, and created objects previously returned by LibOVR functions. The LibOVRRT shared library can be unloaded byovr_Shutdown.
-
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,GetLastErrorInfoshould be called immediately after an API function that returned a failedovrResult, with no other API functions called in the interim.- Parameters:
errorInfo- The lastOVRErrorInfofor the current thread
-
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
-
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
OVRLogCallbackif it was registered.- Parameters:
level- anovrLogLevelconstant. One of:LogLevel_DebugLogLevel_InfoLogLevel_Errormessage- a UTF8-encoded null-terminated string- Returns:
- the
strlenof the message or a negative value if the message is too large
-
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
Initializeand 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:
('true' or 'false')\n Example code:
ovr_IdentifyClient( "EngineName: Unity\n" + "EngineVersion: 5.3.3\n" + "EnginePluginName: OVRPlugin\n" + "EnginePluginVersion: 1.2.0\n" + "EngineEditor: true");- Parameters:
identity- specifies one or more newline-delimited lines of optional info
-
ovr_GetHmdDesc
public static OVRHmdDesc ovr_GetHmdDesc(long session, OVRHmdDesc __result)
Returns information about the current HMD.Initializemust be called prior to calling this function, otherwiseovrHmdDesc::Typewill be set toHmd_Nonewithout checking for the HMD presence.- Parameters:
session- anovrSessionpreviously returned byCreateorNULL__result- anOVRHmdDesc. If invoked withNULLsession argument,ovrHmdDesc::TypetoHmd_Noneindicates that the HMD is not connected.
-
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.
- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_GetTrackerDesc
public static OVRTrackerDesc ovr_GetTrackerDesc(long session, int trackerDescIndex, OVRTrackerDesc __result)
Returns a given attached tracker description.Initializemust have first been called in order for this to succeed, otherwise the returnedtrackerDescArraywill be zero-initialized. The data returned by this function can change at runtime.- Parameters:
session- anovrSessionpreviously returned byCreatetrackerDescIndex- a tracker index. The valid indexes are in the range of 0 to the tracker count returned byGetTrackerCount.__result- anOVRTrackerDesc. An emptyOVRTrackerDescwill be returned iftrackerDescIndexis out of range.
-
ovr_Create
public static int ovr_Create(org.lwjgl.PointerBuffer pSession, OVRGraphicsLuid pLuid)Creates a handle to a VR session.Upon success the returned
ovrSessionmust be eventually freed withDestroywhen it is no longer needed. A second call toCreatewill result in an error return value if the previous session has not been destroyed.- Parameters:
pSession- a pointer to anovrSessionwhich 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
ovrResultindicating success or failure. Upon failure the returnedovrSessionwill beNULL.
-
ovr_Destroy
public static void ovr_Destroy(long session)
Destroys the session.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_GetSessionStatus
public static int ovr_GetSessionStatus(long session, OVRSessionStatus sessionStatus)Returns status information for the application.- Parameters:
session- anovrSessionpreviously returned byCreatesessionStatus- anOVRSessionStatusthat is filled in
-
ovr_IsExtensionSupported
public static int ovr_IsExtensionSupported(long session, int extension, java.nio.ByteBuffer outExtensionSupported)Queries extension support status.- Parameters:
session- anovrSessionpreviously returned byCreateextension- extension to queryoutExtensionSupported- set to extension support status.Trueif supported.- Returns:
- an
ovrResultindicating success or failure. In the case of failure useGetLastErrorInfoto get more information.
-
ovr_EnableExtension
public static int ovr_EnableExtension(long session, int extension)Enable extension. Extensions must be enabled afterCreateis called.- Parameters:
session- anovrSessionpreviously returned byCreateextension- extension to enable.- Returns:
- an
ovrResultindicating success or failure. Extension is only enabled if successful. In the case of failure useGetLastErrorInfoto get more information.
-
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.
-
ovr_GetTrackingOriginType
public static int ovr_GetTrackingOriginType(long session)
Gets the tracking origin state.- Parameters:
session- anovrSessionpreviously returned byCreate
-
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
SpecifyTrackingOrigininstead.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
ovrTrackerPosesthen you will need to callGetTrackerPoseafter 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
ovrTrackingOriginenumeration to understand how recenter will vary slightly in its behavior based on the currentovrTrackingOriginsetting.- Parameters:
session- anovrSessionpreviously returned byCreate
-
ovr_SpecifyTrackingOrigin
public static int ovr_SpecifyTrackingOrigin(long session, OVRPosef originPose)Allows manually tweaking the sensor position and orientation.This function is similar to
RecenterTrackingOriginin 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_RecenterTrackingOriginresets the tracking origin in reference to the HMD's current pose,ovr_SpecifyTrackingOriginallows 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
ovrTrackerPosesthen you will need to callGetTrackerPoseafter this, because the sensor position(s) will change as a result of this.For more info, see the notes on each
ovrTrackingOriginenumeration to understand how recenter will vary slightly in its behavior based on the currentovrTrackingOriginsetting.- Parameters:
session- anovrSessionpreviously returned byCreateoriginPose- specifies a pose that will be used to transform the current tracking origin
-
ovr_ClearShouldRecenterFlag
public static void ovr_ClearShouldRecenterFlag(long session)
Clears theShouldRecenterstatus bit inOVRSessionStatus.Clears the
ShouldRecenterstatus bit inOVRSessionStatus, allowing further recenter requests to be detected. Since this is automatically done byRecenterTrackingOriginandSpecifyTrackingOrigin, this function only needs to be called when application is doing its own re-centering logic.- Parameters:
session- anovrSessionpreviously returned byCreate
-
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
absTimevalue of 0.0 to request the most recent sensor reading. In this case bothPredictedPoseandSamplePosewill 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- anovrSessionpreviously returned byCreateabsTime- the absolute future time to predict the returnOVRTrackingStatevalue. 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 givenovrLayerprovides "SensorSampleTime", that will override the value stored here.__result- theOVRTrackingStatethat is predicted for the givenabsTime
-
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 thedeviceTypesarray parameter.- Parameters:
session- anovrSessionpreviously returned byCreatedeviceTypes- array of device types to query for their posesabsTime- specifies the absolute future time to predict the returnovrTrackingStatevalue. Use 0 to request the most recent tracking state.outDevicePoses- array of poses, one for each device type indeviceTypesarrays- Returns:
- an
ovrResultfor whichOVR_SUCCESS(result)is false upon error and true upon success
-
ovr_GetTrackerPose
public static OVRTrackerPose ovr_GetTrackerPose(long session, int trackerPoseIndex, OVRTrackerPose __result)
Returns theOVRTrackerPosefor the given attached tracker.- Parameters:
session- anovrSessionpreviously returned byCreatetrackerPoseIndex- index of the tracker being requested.
-
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.
-
ovr_GetConnectedControllerTypes
public static int ovr_GetConnectedControllerTypes(long session)
Returns controller types connected to the system OR'ed together.- Parameters:
session- anovrSessionpreviously returned byCreate
-
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- anovrSessionpreviously returned byCreatecontrollerType- the controller to retrieve the information from__result- anOVRTouchHapticsDesc
-
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_SetControllerVibrationcannot be used interchangeably withSubmitControllerVibration.This method should be called periodically, vibration lasts for a maximum of 2.5 seconds.
- Parameters:
session- anovrSessionpreviously returned byCreatecontrollerType- 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
ovrResultfor 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 bycontrollerTypeis not available.
-
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_SubmitControllerVibrationcannot be used interchangeably withSetControllerVibration.- Parameters:
session- anovrSessionpreviously returned byCreatecontrollerType- the controller where the Haptics buffer will be playedbuffer- the Haptics buffer containing amplitude samples to be played- Returns:
- an
ovrResultfor 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 bycontrollerTypeis not available.
-
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- anovrSessionpreviously returned byCreatecontrollerType- the controller where the Haptics buffer will be playedoutState- the state of the haptics engine- Returns:
- an
ovrResultfor 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 bycontrollerTypeis not available.
-
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
TestBoundaryPointbut can be more precise as it may take into account device acceleration/momentum.- Parameters:
session- anovrSessionpreviously returned byCreatedeviceBitmask- bitmask of one or more tracked devices to test. One or more of:TrackedDevice_NoneTrackedDevice_HMDTrackedDevice_LTouchTrackedDevice_RTouchTrackedDevice_TouchTrackedDevice_Object0TrackedDevice_Object1TrackedDevice_Object2TrackedDevice_Object3TrackedDevice_AllboundaryType- the boundary type. One of:Boundary_OuterBoundary_PlayAreaoutTestResult- result of collision/proximity test, contains information such as distance and closest point- Returns:
- an
ovrResultfor 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 bydeviceBitmaskis not available.
-
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- anovrSessionpreviously returned byCreatepoint- the 3D point to testsingleBoundaryType- the boundary type. One of:Boundary_OuterBoundary_PlayAreaoutTestResult- result of collision/proximity test, contains information such as distance and closest point- Returns:
- an
ovrResultfor 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.
-
ovr_SetBoundaryLookAndFeel
public static int ovr_SetBoundaryLookAndFeel(long session, OVRBoundaryLookAndFeel lookAndFeel)Sets the look and feel of the Boundary System.
-
ovr_ResetBoundaryLookAndFeel
public static int ovr_ResetBoundaryLookAndFeel(long session)
Resets the look and feel of the Boundary System to its default state.
-
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- anovrSessionpreviously returned byCreateboundaryType- the boundary type. One of:Boundary_OuterBoundary_PlayAreaoutFloorPoints- an array of 3D points (in clockwise order) defining the boundary at floor height (can beNULLto retrieve only the number of points)outFloorPointsCount- the number of 3D points returned in the array- Returns:
- an
ovrResultfor 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.
-
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- anovrSessionpreviously returned byCreateboundaryType- the boundary type. One of:Boundary_OuterBoundary_PlayAreaoutDimensions- dimensions of the axis aligned bounding box that encloses the area in meters (width, height and length)- Returns:
- an
ovrResultfor 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.
-
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- anovrSessionpreviously returned byCreateoutIsVisible-True, if the boundary is visible- Returns:
- an
ovrResultfor 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.
-
ovr_RequestBoundaryVisible
public static int ovr_RequestBoundaryVisible(long session, boolean visible)Requests boundary to be visible.
-
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- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainfor which the length should be retrievedout_Length- returns the number of buffers in the specified chain
-
ovr_GetTextureSwapChainCurrentIndex
public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, java.nio.IntBuffer out_Index)Gets the current index in anovrTextureSwapChain.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainfor which the index should be retrievedout_Index- returns the current (free) index in specified chain
-
ovr_GetTextureSwapChainDesc
public static int ovr_GetTextureSwapChainDesc(long session, long chain, OVRTextureSwapChainDesc out_Desc)Gets the description of the buffers in anovrTextureSwapChain.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainfor which the description should be retrievedout_Desc- returns the description of the specified chain
-
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- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainto commit
-
ovr_DestroyTextureSwapChain
public static void ovr_DestroyTextureSwapChain(long session, long chain)Destroys anovrTextureSwapChainand frees all the resources associated with it.- Parameters:
session- anovrSessionpreviously returned byCreatechain- theovrTextureSwapChainto destroy. If it isNULLthen this function has no effect.
-
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- anovrSessionpreviously returned byCreatemirrorTexture- theovrTextureto destroy. If it isNULLthen this function has no effect.
-
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- anovrSessionpreviously returned byCreateeye- which eye (left or right) to calculate for. One of:Eye_LeftEye_Rightfov- theOVRFovPortto 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
-
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- anovrSessionpreviously returned byCreateeyeType- which eye (left or right) for which to perform calculations. One of:Eye_LeftEye_Rightfov- theOVRFovPortto use.__result- the computedOVREyeRenderDescfor the giveneyeTypeand field of view
-
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- anovrSessionpreviously returned byCreateframeIndex- specifies the targeted application frame index- Returns:
- an
ovrResultfor 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 callGetSessionStatusto 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_Createcall returns a differentGraphicsLuid.
-
ovr_BeginFrame
public static int ovr_BeginFrame(long session, long frameIndex)Called from render thread before application begins rendering. Must be called afterWaitToBeginFrameand beforeEndFrame, but not necessarily from the same threads.- Parameters:
session- anovrSessionpreviously returned byCreateframeIndex- specifies the targeted application frame index. It must match what was passed toWaitToBeginFrame.- Returns:
- an
ovrResultfor 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_Createcall returns a differentGraphicsLuid.
-
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_SubmitFrameor it won't be displayed. - If a
layerPtrListentry that was specified in a previous call toSubmitFrameis passed asNULLor is of typeLayerType_Disabled, that layer is no longer displayed. - A
layerPtrListentry can be of any layer type and multiple entries of the same layer type are allowed. NolayerPtrListentry 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- anovrSessionpreviously returned byCreateframeIndex- specifies the targeted application frame index. It must match what was passed toBeginFrame.viewScaleDesc- provides additional information needed only iflayerPtrListcontains 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 includeNULLentries 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 asOVRLayerEyeFovorOVRLayerQuad, withHeader.Typeidentifying its type. ANULLlayerPtrList entry in the array indicates the absence of the given layer.- Returns:
- an
ovrResultfor 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_Createcall returns a differentGraphicsLuid.Error_TextureSwapChainInvalid: TheovrTextureSwapChainis in an incomplete or inconsistent state. EnsureCommitTextureSwapChainwas called at least once first.
-
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
EndFrameinstead.ovr_SubmitFrametriggers 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_SubmitFrameor it won't be displayed. - If a
layerPtrListentry that was specified in a previous call toovr_SubmitFrameis passed asNULLor is of typeLayerType_Disabled, that layer is no longer displayed. - A
layerPtrListentry can be of any layer type and multiple entries of the same layer type are allowed. NolayerPtrListentry 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- anovrSessionpreviously returned byCreateframeIndex- the targeted application frame index, or 0 to refer to one frame after the last timeSubmitFramewas calledviewScaleDesc- provides additional information needed only iflayerPtrListcontains anLayerType_Quad. IfNULL, a default version is used based on the current configuration and a 1.0 world scale.layerPtrList- a list ofovrLayerpointers, which can includeNULLentries 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 asOVRLayerEyeFovorOVRLayerQuad, withHeader.Typeidentifying its type. ANULLlayerPtrListentry in the array indicates the absence of the given layer.- Returns:
- an
ovrResultfor 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, callGetSessionStatusto 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_Createcall returns a differentGraphicsLuid.Error_TextureSwapChainInvalid: TheovrTextureSwapChainis in an incomplete or inconsistent state. EnsureCommitTextureSwapChainwas called at least once first.
-
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
VisibleProcessIdwith their own process ID. Normally this will be the case if the caller is only callingovr_GetPerfStatswhenGetSessionStatushasIsVisibleflag set to be true.If the VR app calling
ovr_GetPerfStatsis 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_GetPerfStatsafter the first one without callingovr_SubmitFramewill receive aFrameStatsCountof zero.If the VR app is not visible, or was initially marked as
Init_Invisible, then each call toovr_GetPerfStatswill immediately fetch new perf stats from the compositor without a need for theovr_SubmitFramecall.Even though invisible VR apps do not require
ovr_SubmitFrameto 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- anovrSessionpreviously returned byCreateoutStats- contains the performance stats for the application and SDK compositor- Returns:
- an
ovrResultfor whichOVR_SUCCESS(result)is false upon error and true upon success
-
ovr_ResetPerfStats
public static int ovr_ResetPerfStats(long session)
Resets the accumulated stats reported in eachOVRPerfStatsPerCompositorFrameback to zero.Only the integer values such as
HmdVsyncIndex,AppDroppedFrameCountetc. will be reset as the other fields such asAppMotionToPhotonLatencyare independent timing values updated per-frame.- Parameters:
session- anovrSessionpreviously returned byCreate- Returns:
- an
ovrResultfor whichOVR_SUCCESS(result)is false upon error and true upon success
-
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- anovrSessionpreviously returned byCreateframeIndex- 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
-
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- anovrSessionpreviously returned byCreatecameras- pointer to the array. IfNULLand the provided array capacity is sufficient, will returnovrError_NullArrayPointer.inoutCameraCount- supplies the array capacity, will return the actual \# of cameras defined. IfinoutCameraCountis too small, will returnError_InsufficientArraySize.- Returns:
- the ids of external cameras the system knows about. Returns
Error_NoExternalCameraInfoif there is not any external camera information.
-
ovr_SetExternalCameraProperties
public static int ovr_SetExternalCameraProperties(long session, java.nio.ByteBuffer name, @Nullable OVRCameraIntrinsics intrinsics, @Nullable OVRCameraExtrinsics extrinsics) public static int ovr_SetExternalCameraProperties(long session, java.lang.CharSequence name, @Nullable OVRCameraIntrinsics intrinsics, @Nullable OVRCameraExtrinsics extrinsics)Sets the camera intrinsics and/or extrinsics stored for thenamecamera.Names must be < 32 characters and null-terminated.
- Parameters:
session- anovrSessionpreviously returned byCreatename- specifies which camera to set the intrinsics or extrinsics forintrinsics- contains the intrinsic parameters to set, can be nullextrinsics- contains the extrinsic parameters to set, can be null
-
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- anovrSessionpreviously returned byCreatepropertyName- 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
defaultValif the property doesn't exist.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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
defaultValif the property doesn't exist.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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
defaultValif the property doesn't exist.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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
-
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- anovrSessionpreviously returned byCreatepropertyName- 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.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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_GetStringor until the HMD is destroyed, whichever occurs first.
-
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- anovrSessionpreviously returned byCreatepropertyName- 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.
-
ovr_GetDevicePoses
public static int ovr_GetDevicePoses(long session, int[] deviceTypes, double absTime, OVRPoseStatef.Buffer outDevicePoses)Array version of:GetDevicePoses
-
ovr_GetBoundaryGeometry
public static int ovr_GetBoundaryGeometry(long session, int boundaryType, @Nullable OVRVector3f outFloorPoints, @Nullable int[] outFloorPointsCount)Array version of:GetBoundaryGeometry
-
ovr_GetTextureSwapChainLength
public static int ovr_GetTextureSwapChainLength(long session, long chain, int[] out_Length)Array version of:GetTextureSwapChainLength
-
ovr_GetTextureSwapChainCurrentIndex
public static int ovr_GetTextureSwapChainCurrentIndex(long session, long chain, int[] out_Index)Array version of:GetTextureSwapChainCurrentIndex
-
ovr_GetExternalCameras
public static int ovr_GetExternalCameras(long session, @Nullable OVRExternalCamera.Buffer cameras, int[] inoutCameraCount)Array version of:GetExternalCameras
-
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
-
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
-
-