UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials

engine.oculus Functions

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

To get access to the functions of the AppOculus plugin, wrap the code around with the following:

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

vec4 engine.oculus.getAberration ()

Returns chromatic aberration correction coefficients.

Return value

Aberration correction coefficients.

vec3 engine.oculus.getAcceleration ()

Returns the acceleration vector.

Return value

Acceleration vector.

vec3 engine.oculus.getAngularVelocity ()

Returns the angular velocity.

Return value

Angular velocity.

string engine.oculus.getDeviceName ()

Returns the name of the connected device.

Return value

Name of the connected device.

vec4 engine.oculus.getDistortion ()

Returns radial distortion correction coefficients.

Return value

Distortion correction coefficients.

float engine.oculus.getEyeToScreenDistance ()

Returns the distance from the eye to the screen surface.

Return value

Distance from the eye to the screen surface.

int engine.oculus.getGravity ()

Returns a value indicating if the gravity is enabled.

Return value

1 if the gravity is enabled; otherwise, 0.

float engine.oculus.getInterpupillaryDistance ()

Returns the distance between the eye centers.

Return value

Distance between the eye centers. The default is 0.064.

float engine.oculus.getLensSeparationDistance ()

Returns the distance between lens centers. The lens separation distance is used to calculate screen distortion.

Return value

Distance between lens centers

quat engine.oculus.getOrientation ()

Returns the sensor orientation value.

Return value

Sensor orientation.

quat engine.oculus.getPredictedOrientation ()

Returns the predicted orientation value.

Return value

Predicted orientation of the sensor.

float engine.oculus.getPredictionDelta ()

Returns the prediction delta, which specifies how much prediction will be applied, in seconds.

Return value

Prediction delta, in seconds.

int engine.oculus.getPrediction ()

Returns a value indicating if the prediction on orientation is enabled.

Return value

1 if the prediction is enabled; otherwise, 0.

float engine.oculus.getScreenCenter ()

Returns offset from the top of the screen to the eye center.

Return value

Offset from the top of the screen to the eye center. The default is 0.0468.

float engine.oculus.getScreenDistortion ()

Returns the screen distortion. It depends on such parameters as the lens separation distance, screen width and radial distortion correction coefficients.

Return value

Screen distortion.

float engine.oculus.getScreenHeight ()

Returns height of the active screen.

Return value

Height of the active screen. The default is 0.0936.

float engine.oculus.getScreenWidth ()

Returns width of the active screen.

Return value

Width of the active screen. The default is 0.14976.

void engine.oculus.reset ()

Resets the current orientation and acceleration.

void engine.oculus.setAberration (vec4 a)

Sets chromatic aberration correction coefficients.

Arguments

  • vec4 a - Aberration correction coefficients.

void engine.oculus.setDistortion (vec4 d)

Sets radial distortion correction coefficients.

Arguments

  • vec4 d - Distortion correction coefficients.

void engine.oculus.setGravity (int gravity)

Sets a value indicating if the gravity is enabled.

Arguments

  • int gravity - 1 if the gravity is enabled; otherwise, 0.

void engine.oculus.setPredictionDelta (float delta)

Sets the prediction delta, which specifies how much prediction will be applied, in seconds.

Arguments

  • float delta - Prediction delta, in seconds.

void engine.oculus.setPrediction (int enabled)

Sets a value indicating if the prediction on orientation is enabled.

Arguments

  • int enabled - 1 to enable the prediction; otherwise, 0.

void engine.oculus.setSensorRange (vec3 r)

Sets maximum value ranges that a hardware is configured to detect.
Last update: 2017-07-03