Unigine.Plugins.AppOculus Class
This set of functions is available when the AppOculus plugin is loaded.
AppOculus plugin cannot be used in a Qt-based application
If the plugin is loaded together with the engine, the HAS_APP_OCULUS definition is set. This definition can be used, for example, to avoid errors if the plugin is not loaded: the code in which the plugin functions are executed can be wrapped around as follows:
#ifdef HAS_APP_OCULUS
// engine.oculus functions
#endif
For more detailed information on application development with the Oculus Rift support, check also the following:
- openvr File Reference
- The Oculus Best Practices document and the Oculus Developer Guide document that can be downloaded from the official website.
See also#
A UnigineScript API sample <UnigineSDK>/data/samples/plugins/app_oculus_00
AppOculus Class
Enums
AXIS#
TOUCH#
BUTTON#
DEVICE#
Name | Description |
---|---|
HMD = 0 | Oculus head-mounted display. |
CONTROLLER_LEFT = 1 | Left controller. |
CONTROLLER_RIGHT = 2 | Right controller. |
VIEWPORT#
Name | Description |
---|---|
BLACK_SCREEN = 0 | No image (black screen). |
MONO = 1 | Mono image. |
STEREO = 2 | Stereo image (left and right eye). |
STEREO_FINAL = 3 | Stereoscopic spherical image. |
Properties
float PositionScale#
The current world scale. when increasing the scale, the objects get smaller when they are farther away.
AppOculus.VIEWPORT ViewportMode#
The A value indicating the current viewport mode, that determines the type of image to be displayed in the viewport.
bool Enabled#
The value indicating if the VR mode is enabled or not.
bool IsVisible#
The value indicating if the information about the HMD session status is visible.
uint TrackingStatus#
The current status of the sensor tracking.
quat LeveledTrackerRotation#
The current orientation (only sensor yaw, not roll and pitch) of the leveled sensor (aligned with gravity) relative to the tracking origin.
vec3 LeveledTrackerPosition#
The current position of the leveled sensor (aligned with gravity) relative to the tracking origin.
quat TrackerRotation#
The current orientation (sensor roll and pitch) of the sensor relative to the tracking origin.
vec3 TrackerPosition#
The current position of the sensor relative to the tracking origin.
vec3 HeadAngularAcceleration#
The current orientation of the head.
vec3 HeadLinearAcceleration#
The current linear acceleration of the head.
vec3 HeadAngularVelocity#
The current angular acceleration of the head.
vec3 HeadLinearVelocity#
The current linear acceleration of the head.
quat HeadRotation#
The Returns the current orientation of the head.
vec3 HeadPosition#
The current orientation of the head.
string HmdSerialNumber#
The serial number of the device.
int HmdHeight#
The vertical resolution of the full HMD screen (both eyes) in pixels.
int HmdWidth#
The horizontal resolution of the full HMD screen (both eyes) in pixels.
int AvailableTrackingCaps#
The Tracking capability bits that the system currently supports.
int AvailableHmdCaps#
The HMD capability bits that the device currently supports.
int DefaultTrackingCaps#
The Tracking capability bits that are default for the current system.
int DefaultHmdCaps#
The HMD capability bits that are default for the current device.
float HmdTrackerZFar#
The distance from the tracking sensor to the far Z clipping plane of viewing frustum.
float HmdTrackerZNear#
The distance from the tracking sensor to the near Z clipping plane of viewing frustum.
float HmdTrackerVFov#
The vertical FOV (if present) of the tracking sensor frustum in degrees.
float HmdTrackerHFov#
The horizontal FOV (if present) of the tracking sensor frustum in degrees.
int HmdFirmwareMinor#
The minor version of the device firmware.
int HmdFirmwareMajor#
The major version of the device firmware.
int HmdProductID#
The HID (USB) product identifier of the device.
int HmdVendorID#
The HID (USB) vendor identifier of the device.
string HmdManufacturer#
The name of the device manufacturer (UTF-8 encoded identification string).
string HmdProductName#
The name of the device (UTF-8 encoded product identification string).
int HmdType#
The type of the device.
string Version#
The libOVRRT version of the device.
Members
void SetControllerVibration ( AppOculus.DEVICE device, ushort duration, float amplitude ) #
Sets the vibration of the given duration and amplitude.Arguments
- AppOculus.DEVICE device - Device ID, one of the DEVICE variables.
- ushort duration - Duration of the vibration.
- float amplitude - Amplitude of the vibration.
bool IsDeviceConnected ( AppOculus.DEVICE device ) #
Returns a value indicating if the device connected to the slot.Arguments
- AppOculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
true - connected; false - not connected.void SetHeadPositionLock ( bool lock ) #
Locks the head position.Arguments
- bool lock - true to lock the head position.
bool IsHeadPositionLocked ( ) #
Returns the value indicating if the head position is locked.Return value
true if the head position is locked; otherwise - false.void SetHeadRotationLock ( bool lock ) #
Locks the head rotation.Arguments
- bool lock - true to lock the head rotation.
bool IsHeadRotationLocked ( ) #
Returns the value indicating if the head rotation is locked.Return value
true if the head rotation is locked; otherwise - false.bool IsPoseValid ( AppOculus.DEVICE device ) #
Returns a value indicating if the device pose is valid.Arguments
- AppOculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
true - valid; false - invalid.bool IsVisible ( ) #
Returns a value indicating if the process has VR focus and thus is visible in HMD.Return value
true if the information about the HMD session status is visible; otherwise, false.Last update:
2021-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)