Unigine.InputVRDevice Class
The base class for VR devices. It provides access to properties and settings that all VR devices have. For example, you can get a device name, check if it has a battery, or whether it will drift in a specific direction, and so on.
Also, the class functionality allows getting the model of the VR device. For example, you can use it for controller rendering:
- Get the controller to render by using the corresponding methods of the Input class. For example, to get the left controller, call getVRControllerLeft().
- Check it exists.
- Get the number of its models via getNumModels().
- Load its meshes and textures individually, one by one, or get the entire mesh at once. Note that there may be a delay during the loading process.
- Render the loaded meshes with textures.
InputVRDevice Class
Enums
TYPE#
TRANSFORM_TYPE#
Name | Description |
---|---|
AIM = 0 | (OpenXR only) A pose that allows applications to point in the world using the input source, according to the platform’s conventions for aiming with that kind of source. The aim pose is defined as follows:
|
GRIP = 1 | A pose that allows applications to reliably render a virtual object held in the user’s hand, whether it is tracked directly or by a motion controller. The grip pose is defined as follows:
|
MESH = 2 | A pose (grip_surface) that allows applications to reliably anchor visual content relative to the user’s physical hand, whether the user’s hand is tracked directly or its position and orientation is inferred by a physical controller. The grip_surface pose is defined as follows:
|
PINCH = 3 | Pinch pose designed for interacting with a small object within arm’s reach using a finger and thumb with a "pinch" gesture. For example, turning a key to open a lock or moving the knob on a slider control are interactions suited to the "pinch" pose. |
POKE = 4 | Poke pose designed for interactions using a fingertip to touch and push a small object. For example, pressing a push button with a fingertip, swiping to scroll a browser view, or typing on a virtual keyboard are interactions suited to the "poke" pose. |
NUM_TRANSFORM_TYPES = 5 | Total number of transformation types. |
Properties
bool IsAvailable#
The value indicating if the VR device is available.
int Number#
The index of the VR device.
string Name#
The name of the VR device.
Input.DEVICE DeviceType#
The type of the input device (wheel, throttle, etc.).
InputVRDevice.TYPE Type#
The type of the VR device (HMD, controller, base station, etc.).
string DeviceModelName#
The name of the model of the VR device.
bool IsCharging#
The value indicating if the VR device is charging.
float BatteryValue#
The battery level.
string ModelNumber#
The model number for the VR device.
string SerialNumber#
The serial number for the VR device.
string ManufacturerName#
The name of the VR device's vendor.
ulong HardwareRevision#
The hardware revision of the VR device.
ulong FirmwareVersion#
The firmware revision of the VR device.
int NumModels#
The number of VR device's models.
Mesh CombinedModelMesh#
The entire mesh of the combined model of the VR device.
You cannot animate this mesh. However, if you get a mesh of each model individually, it will be automatically animated.
Texture CombinedModelTexture#
The texture of the combined model of the VR device.
string CombinedModelName#
The name of the combined model of the VR device.
Members
bool HasYawDrift ( ) #
Returns a value indicating if the VR device will drift in a specific direction.Return value
true if the device has yaw drift; otherwise, false.bool HasBattery ( ) #
Returns a value indicating if the VR device has a battery.Return value
true if the device has the battery; otherwise, false.bool CanReportBatteryValue ( ) #
Returns a value indicating if the VR device provides the battery status.Return value
true if the battery status is provided; otherwise, false.bool IsVelocityValid ( InputVRDevice.TRANSFORM_TYPE type = Enum.InputVRDevice.TRANSFORM_TYPE.GRIP ) #
Returns a value indicating if the velocity of the VR device for the specified transformation type is valid.Arguments
- InputVRDevice.TRANSFORM_TYPE type - Transformation type.
Return value
true if velocity is valid; otherwise, false.bool IsTransformTypeSupported ( InputVRDevice.TRANSFORM_TYPE type = Enum.InputVRDevice.TRANSFORM_TYPE.GRIP ) #
Returns a value indicating if the VR device supports the specified transformation type.Arguments
- InputVRDevice.TRANSFORM_TYPE type - Transformation type.
Return value
true if transformation type is supported; otherwise, false.mat4 GetModelTransform ( int num ) #
Returns the local transformation of the given model.Arguments
- int num - Model index.
Return value
Local transformation matrix of the model.mat4 GetModelWorldTransform ( int num ) #
Returns the world transformation of the given model.Arguments
- int num - Model index.
Return value
World transformation matrix of the model.Mesh GetModelMesh ( int num ) #
Returns the mesh of the given model.Arguments
- int num - Model index.
Return value
Model mesh.Texture GetModelTexture ( int num ) #
Returns the texture of the given model.Arguments
- int num - Model index.
Return value
Model texture.string GetModelName ( int num ) #
Returns the name of the given model.Arguments
- int num - Model index.
Return value
Model name.Last update:
2024-10-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)