GoogleVR - stingray.GoogleVR namespace reference - Stingray Lua API Reference

stingray.GoogleVR namespace reference

Description

This object provides access to the Google VR interface.

Functions

Parameters

eye :

integer

The eye to query (stingray.GoogleVR.LEFT_EYE or stingray.GoogleVR.RIGHT_EYE)

point :

stingray.Vector2

a point in screen eye Viewport Space in [0,1]^2 with (0, 0) in the lower left corner of the eye's viewport and (1, 1) in the upper right corner of the eye's viewport

Returns

stingray.Vector2+

Returns three Vector2 with the red, green and blue distorted points.

The + notation indicates that there may be one or more instances of the specified type.

The distortion inverts the optical distortion caused by the lens for the eye. Due to chromatic aberration, the distortion is different for each color channel.

Parameters
This function does not accept any parameters.
Returns

stingray.Vector3

Acceleration direction in meters per second squared of the controller

Parameters
This function does not accept any parameters.
Returns

integer

The API status of the controller [GoogleVR.STATUS_API_OK, GoogleVR.STATUS_API_UNSUPPORTED, GoogleVR.STATUS_API_NOT_AUTHORIZED, GoogleVR.STATUS_API_UNAVAILABLE, GoogleVR.STATUS_API_SERVICE_OBSOLETE, GoogleVR.STATUS_API_CLIENT_OBSOLETE, GoogleVR.STATUS_API_MALFUNCTION]

Parameters

status :

integer

Controller API status [GoogleVR.STATUS_API_OK, GoogleVR.STATUS_API_UNSUPPORTED, GoogleVR.STATUS_API_NOT_AUTHORIZED, GoogleVR.STATUS_API_UNAVAILABLE, GoogleVR.STATUS_API_SERVICE_OBSOLETE, GoogleVR.STATUS_API_CLIENT_OBSOLETE, GoogleVR.STATUS_API_MALFUNCTION]

Returns

string

The API status of the controller as a string

Parameters
This function does not accept any parameters.
Returns

integer

The connection status of the controller [GoogleVR.STATUS_DISCONNECTED, GoogleVR.STATUS_SCANNING, GoogleVR.STATUS_CONNECTING, GoogleVR.STATUS_CONNECTED]

Parameters

status :

integer

Controller connection status [GoogleVR.STATUS_DISCONNECTED, GoogleVR.STATUS_SCANNING, GoogleVR.STATUS_CONNECTING, GoogleVR.STATUS_CONNECTED]

Returns

string

The connection status of the controller as a string

Parameters
This function does not accept any parameters.
Returns

stingray.Vector3

Angular speed in radians of the controller

Parameters

button :

integer

Controller button [GoogleVR.BUTTON_CLICK, GoogleVR.BUTTON_HOME, GoogleVR.BUTTON_APP, GoogleVR.BUTTON_VOLUME_UP, GoogleVR.BUTTON_VOLUME_DOWN]

Returns

boolean

true if specified button is held on the controller, false otherwise

Parameters
This function does not accept any parameters.
Returns

stingray.Quaternion

Orientation of the controller

Parameters

button :

integer

Controller button [GoogleVR.BUTTON_CLICK, GoogleVR.BUTTON_HOME, GoogleVR.BUTTON_APP, GoogleVR.BUTTON_VOLUME_UP, GoogleVR.BUTTON_VOLUME_DOWN]

Returns

boolean

true if specified button is pressed on controller, false otherwise.

This is a "transient" result; when it is true it will be true for only one frame after the event, and false for calls in subsequent frames.

Parameters

button :

integer

Controller button [GoogleVR.BUTTON_CLICK, GoogleVR.BUTTON_HOME, GoogleVR.BUTTON_APP, GoogleVR.BUTTON_VOLUME_UP, GoogleVR.BUTTON_VOLUME_DOWN]

Returns

boolean

true if specified button is released on controller, false otherwise.

This is a "transient" result; when it is true it will be true for only one frame after the event, and false for calls in subsequent frames.

Parameters
This function does not accept any parameters.
Returns

boolean

True if touchpad is touched on the controller, false otherwise

Parameters
This function does not accept any parameters.
Returns

boolean

true if user just started touching the touchpad, false otherwise.

This is a "transient" result; when it is true it will be true for only one frame after the event, and false for calls in subsequent frames.

Parameters
This function does not accept any parameters.
Returns

stingray.Vector2

Touch position in normalized coordinates of the controller's touchpad

Parameters
This function does not accept any parameters.
Returns

boolean

true if user just stopped touching the touchpad, false otherwise.

This is a "transient" result; when it is true it will be true for only one frame after the event, and false for calls in subsequent frames.

Parameters

controller :

integer

Controller index (Unused for GoogleVR, set to 0)

button :

integer

Controller button [GoogleVR.BUTTON_CLICK, GoogleVR.BUTTON_HOME, GoogleVR.BUTTON_APP, GoogleVR.BUTTON_VOLUME_UP, GoogleVR.BUTTON_VOLUME_DOWN]

Returns

number

First analog value of specified controller button. If unused, 0.0 is returned.

number

Second analog value of specified controller button. If unused, 0.0 is returned.

If GoogleVR.BUTTON_CLICK is requested, x and y analog positions of the touchpad will be returned. Otherwise, for any other button, the first value will contain the analog value (varying between 0 and 1) while the second will always be 0.

Parameters

eye :

integer

The eye to query (stingray.GoogleVR.LEFT_EYE or stingray.GoogleVR.RIGHT_EYE)

Returns

table

Table populated with eye field of view.

Parameters
This function does not accept any parameters.
Returns
This function does not return any values.
Parameters
This function does not accept any parameters.
Returns

table

Table populated with GoogleVR HMD information.

The "type" field identifies the viewer type as "Cardboard", "Daydream", or "unknown".

Parameters
This function does not accept any parameters.
Returns

stingray.Matrix4x4

Head local pose

stingray.Matrix4x4

Left eye local pose

stingray.Matrix4x4

Right eye local pose

Parameters
This function does not accept any parameters.
Returns

stingray.Matrix4x4

Head world pose

stingray.Matrix4x4

Left eye world pose

stingray.Matrix4x4

Right eye world pose

If not tracked, identity matrices are returned.

Parameters
This function does not accept any parameters.
Returns

boolean

Returns true if Google VR was initialized properly, otherwise returns false.

Parameters
This function does not accept any parameters.
Returns
This function does not return any values.
Parameters
This function does not accept any parameters.
Returns
This function does not return any values.

Does nothing on daydream devices (re-centering is handled automatically).

Parameters
This function does not accept any parameters.
Returns
This function does not return any values.
Parameters

left_eye_rt :

string

The left eye render target name.

right_eye_rt :

string

The right eye render target name.

Returns
This function does not return any values.
Parameters

uri :

string

A string that contains either the shortened URI or the standard URI representing the viewer profile that the app should be using.

Returns
This function does not return any values.
Parameters

pose :

stingray.Matrix4x4

Tracking space pose

Returns
This function does not return any values.
Parameters
This function does not accept any parameters.
Returns
This function does not return any values.
Parameters
This function does not accept any parameters.
Returns
This function does not return any values.