Unigine.Plugins.Oculus Class
VR functionality is available out of the box since 2.18 for all supported graphics APIs except OpenGL.
This set of functions is available when the Oculus plugin is loaded.
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
Oculus Class
Перечисления (Enums)
AXIS#
TOUCH#
BUTTON#
DEVICE#
Имя | Описание |
---|---|
HMD = 0 | Oculus head-mounted display. |
CONTROLLER_LEFT = 1 | Left controller. |
CONTROLLER_RIGHT = 2 | Right controller. |
VIEWPORT#
Имя | Описание |
---|---|
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.
Oculus.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.
bool HeadPositionLock#
The value indicating if the head position is locked.
bool HeadRotationLock#
The value indicating if the head rotation is locked.
Members
vec2 GetControllerAxis ( Oculus.DEVICE device, Oculus.AXIS axis ) #
Returns the coordinates of the specified controller axis along the X and Y axes.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
- Oculus.AXIS axis - One of the AXIS variables.
Return value
X and Y in the range of [-1;1] ([0;1] for a trigger).bool GetControllerButtonPressed ( Oculus.BUTTON button ) #
Returns the value indicating if the specified button is pressed.Arguments
- Oculus.BUTTON button - A button, one of the BUTTON variables.
Return value
true if the button is pressed; otherwise - false.bool GetControllerButtonTouched ( Oculus.TOUCH button ) #
Returns the value indicating if the specified button is touched.Arguments
- Oculus.TOUCH button - A button, one of the TOUCH variables.
Return value
true if the button is touched; otherwise - false.void SetControllerVibration ( Oculus.DEVICE device, ushort duration, float amplitude ) #
Sets the vibration of the given duration and amplitude.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
- ushort duration - Duration of the vibration.
- float amplitude - Amplitude of the vibration.
vec3 GetDeviceAngularVelocity ( Oculus.DEVICE device ) #
Returns a device angular velocity, in radians per second.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
Angular velocity.bool IsDeviceConnected ( Oculus.DEVICE device ) #
Returns a value indicating if the device connected to the slot.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
true - connected; false - not connected.mat4 GetDevicePose ( Oculus.DEVICE device ) #
Returns a single pose for a tracked device.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
Identity matrix.vec3 GetDeviceVelocity ( Oculus.DEVICE device ) #
Returns a device velocity in tracker space, in meters per second.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
Velocity.bool IsPoseValid ( Oculus.DEVICE device ) #
Returns a value indicating if the device pose is valid.Arguments
- Oculus.DEVICE device - Device ID, one of the DEVICE variables.
Return value
true - valid; false - invalid.vec4 GetHmdDefaultFov ( int num ) #
Returns the default optical field of view for the specified eye.Arguments
- int num - Eye: 0 for the left eye, 1 for the right eye.
Return value
Default field of view.vec4 GetHmdMaxFov ( int num ) #
Returns the maximum optical field of view that can be practically rendered for the specified eye.Arguments
- int num - Eye: 0 for the left eye, 1 for the right eye.
Return value
Maximum field of view.void ResetTracking ( ) #
Re-centers the sensor position and orientation: the (x,y,z) positional components and the yaw component of orientation. The roll and pitch components are always determined by gravity and cannot be redefined. See also ovr_RecenterTrackingOrigin method in the OVR_CAPI.h file reference.vec4 GetEyeFov ( int num ) #
Returns the current field of view of the given eye.Arguments
- int num - Eye: 0 for the left eye, 1 for the right eye.
Return value
Eye field of view.vec3 GetEyePosition ( int num ) #
Returns the current position of the given eye. The returned value was already multiplied by the current world scale.Arguments
- int num - Eye: 0 for the left eye, 1 for the right eye.
Return value
The eye position.quat GetEyeRotation ( int num ) #
Returns the current orientation of the given eye.Arguments
- int num - Eye: 0 for the left eye, 1 for the right eye.
Return value
The eye orientation.vec3 GetHandPosition ( int num ) #
Returns the current position of the given hand. The returned value was already multiplied by the current world scale.Arguments
- int num - Hand: 0 for the left hand, 1 for the right hand.
quat GetHandRotation ( int num ) #
Returns the current orientation of the given hand.Arguments
- int num - Hand: 0 for the left hand, 1 for the right hand.
void Render ( Player player, ivec2 size, bool render_window ) #
Arguments
Last update:
19.04.2024
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter