This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.Plugins.AppOculus Class

This set of functions is available when the AppOculus plugin is loaded.

Notice
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:

Source code (UnigineScript)
#ifdef HAS_APP_OCULUS
	// engine.oculus functions
#endif

Notice
For more detailed information on application development with the Oculus Rift support, check also the following:

See also#

AppOculus Class

Enums

AXIS#

NameDescription
INDEX_TRIGGER = 0Left and right finger trigger values, in the range 0.0 to 1.0f. A value of 1.0 means that the trigger is fully depressed.
HAND_TRIGGER = 1Left and right hand trigger values, in the range 0.0 to 1.0f. Hand trigger is often used to grab items. A value of 1.0 means that the trigger is fully depressed.
THUMBSTICK = 2Horizontal and vertical thumbstick axis values, in the range -1.0f to 1.0f. The API automatically applies the deadzone, so developers don’t need to handle it explicitly.
INDEX_TRIGGER_NO_DEADZONE = 3Left and right finger trigger values, in the range 0.0 to 1.0f, without a deadzone. A value of 1.0 means that the trigger is fully depressed.
HAND_TRIGGER_NO_DEADZONE = 4Left and right hand trigger values, in the range 0.0 to 1.0f, without a deadzone. Hand trigger is often used to grab items. A value of 1.0 means that the trigger is fully depressed.
THUMBSTICK_NO_DEADZONE = 5Horizontal and vertical thumbstick axis values, in the range -1.0f to 1.0f, without a deadzone.

TOUCH#

NameDescription
A = 1User is touching A button on the right controller.
B = 2User is touching B button on the right controller.
RTHUMB = 4User has a finger on the thumb stick of the right controller.
RTHUMB_REST = 8User has a finger on the textured thumb rest of the right controller.
RINDEX_TRIGGER = 16User is touching the index finger trigger on the right controller.
RINDEX_POINTING = 32User's right index finger is pointing forward past the trigger.
RTHUMB_UP = 64User's right thumb is up and away from buttons on the controller, a gesture that can be interpreted as right thumbs up.
X = 256User is touching X button on the left controller.
Y = 512User is touching Y button on the left controller.
LTHUMB = 1024User has a finger on the thumb stick of the left controller.
LTHUMB_REST = 2048User has a finger on the textured thumb rest of the left controller.
LINDEX_TRIGGER = 4096User is touching the index finger trigger on the left controller.
LINDEX_POINTING = 8192User's left index finger is pointing forward past the trigger.
LTHUMB_UP = 16384User's left thumb is up and away from buttons on the controller, a gesture that can be interpreted as left thumbs up.

BUTTON#

NameDescription
A = 1A button on the right Touch controller.
B = 2B button on the right Touch controller.
RTHUMB = 4Thumb stick button on the right Touch controller.
RSHOULDER = 8Shoulder button on the right Touch controller.
X = 256X button on the left Touch controller.
Y = 512Y button on the left Touch controller.
LTHUMB = 1024Thumb stick button on the left Touch controller.
LSHOULDER = 2048Shoulder button on the left Touch controller.
UP = 65536The Up button on the remote controller.
DOWN = 131072The Down button on the remote controller.
LEFT = 262144The Left button on the remote controller.
RIGHT = 524288The Right button on the remote controller.
ENTER = 1048576Enter button on the left Touch controller. This is equivalent to the Start button on the Xbox controller.
BACK = 2097152The Back button on the remote controller.
VOLUP = 4194304The Volup button on the remote controller.
VOLDOWN = 8388608The Voldown button on the remote controller.
HOME = 16777216The Home button on the remote controller.

DEVICE#

NameDescription
HMD = 0Oculus head-mounted display.
CONTROLLER_LEFT = 1Left controller.
CONTROLLER_RIGHT = 2Right controller.

OCULUS_HMD#

NameDescription
None = 0Absence of a HMD type
DK1 = 3The type of the HMD is Oculus Rift DK1 (Developer Kit 1).
DKHD = 4The type of the HMD is Oculus Rift HD prototype.
DK2 = 6The type of the HMD is Oculus Rift DK2 (Developer Kit 2).
CB = 8The type of the HMD is Crescent Bay prototype. Used by Oculus internally..
Other = 9The type of the HMD is unknown type.
E32015 = 10The type of the HMD demoed at E3 2015. Used by Oculus internally..
ES06 = 11The type of the HMD is a Oculus Rift prototype. Used by Oculus internally.
ES09 = 12The type of the HMD is a Oculus Rift prototype. Used by Oculus internally.
ES11 = 13The type of the HMD is a Oculus Rift prototype. Used by Oculus internally.
CV1 = 14The type of the HMD is Oculus Rift CV1 (Consumer Version 1).

VIEWPORT#

NameDescription
BLACK_SCREEN = 0No image (black screen).
MONO = 1Mono image.
STEREO = 2Stereo image (left and right eye).
STEREO_FINAL = 3Stereoscopic spherical image.

Properties

float PositionScale#

The current world scale. when increasing the scale, the objects get smaller when they are farther away.
set
Sets a new scale for the world. When increasing the scale, the objects get smaller when they are farther away.
set value - World scale.

AppOculus.VIEWPORT ViewportMode#

A value indicating the current viewport mode, that determines the type of image to be displayed in the viewport.
set
Sets the viewport mode, that world scales the type of image to be displayed in the viewport.
set value - Viewport mode. One of the VIEWPORT variables.

bool Enabled#

The value indicating if the VR mode is enabled or not.
set
Toggles the VR mode.
set value - true to enable the VR mode; false to disable it.

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#

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#

Tracking capability bits that the system currently supports.

int AvailableHmdCaps#

HMD capability bits that the device currently supports.

int DefaultTrackingCaps#

Tracking capability bits that are default for the current system.

int DefaultHmdCaps#

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#

HID (USB) product identifier of the device.

int HmdVendorID#

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

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

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-04-29
Build: ()