This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
VR Development
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::InputVRDevice Class

Header: #include <UnigineInput.h>

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:

  1. Get the controller to render by using the corresponding methods of the Input class. For example, to get the left controller, call getVRControllerLeft().
  2. Check it exists.
  3. Get the number of its models via getNumModels().
  4. 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.
  5. Render the loaded meshes with textures.

InputVRDevice Class

Enums

TYPE#

Name说明/描 述
INPUT_VR_UNKNOWN = 0Unknown VR device.
INPUT_VR_DEVICE = 1VR device.
INPUT_VR_HEAD = 2Head-mounted display.
INPUT_VR_CONTROLLER = 3Controller.
INPUT_VR_TRACKER = 4Tracker.
INPUT_VR_BASE_STATION = 5Base station.
NUM_TYPES = 6Total number of types of the VR devices.

Members


bool isAvailable ( ) const#

Returns a value indicating if the VR device is available.

Return value

true if the device is available; otherwise, false.

int getNumber ( ) const#

Returns the index of the VR device.

Return value

Device index.

const char * getName ( ) const#

Returns the name of the VR device.

Return value

Device name.

Input::DEVICE getDeviceType ( ) const#

Returns the type of the input device (wheel, throttle, etc.).

Return value

Input device type.

InputVRDevice::TYPE getType ( ) const#

Returns the type of the VR device (HMD, controller, base station, etc.).

Return value

VR device type.

const char * getDeviceModelName ( ) const#

Returns the name of the model of the VR device.

Return value

Model name.

bool hasYawDrift ( ) const#

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 isCharging ( ) const#

Returns a value indicating if the VR device is charging.

Return value

true if the device is charging; otherwise, false.

bool hasBattery ( ) const#

Returns a value indicating if the VR device has a battery.

Return value

true if the device has the battery; otherwise, false.

bool canReportBatteryValue ( ) const#

Returns a value indicating if the VR device provides the battery status.

Return value

true if the battery status is provided; otherwise, false.

float getBatteryValue ( ) const#

Returns the current battery level.

Return value

Battery level, in percents.

String getModelNumber ( ) const#

Returns the model number for the VR device.

Return value

Model number.

String getSerialNumber ( ) const#

Returns the serial number of the VR device.

Return value

Seril number.

String getManufacturerName ( ) const#

Returns the name of the VR device's vendor.

Return value

Vendor name.

unsigned long long getHardwareRevision ( ) const#

Returns the hardware revision of the VR device.

Return value

Hardware revision.

unsigned long long getFirmwareVersion ( ) const#

Returns the firmware version of the VR device.

Return value

Firmware version

Math::Mat4 getWorldTransform ( ) const#

Retuns the world transformation of the VR device.

Return value

World transformation matrix.

Math::mat4 getTransform ( ) const#

Returns the local transformation of the VR device.

Return value

Local transformation matrix.

Math::vec3 getLinearVelocity ( ) const#

Returns the linear velocity of the VR device.

Return value

Linear velocity.

Math::vec3 getAngularVelocity ( ) const#

Returns the angular velocity of the VR device.

Return value

Angular velocity.

Math::vec3 getAngularAcceleration ( ) const#

Returns the angular acceleration of the VR device.

Return value

Angular acceleration.

bool isTransformValid ( ) const#

Returns a value indicating if transformation if the VR device is valid.

Return value

true if transformation is valid; otherwise, false.

int getNumModels ( ) const#

Returns the number of VR device's models.

Return value

Number of models.

Math::mat4 getModelTransform ( int num ) const#

Returns the local transformation of the given model.

Arguments

  • int num - Model index.

Return value

Local transformation matrix of the model.

Math::Mat4 getModelWorldTransform ( int num ) const#

Returns the world transformation of the given model.

Arguments

  • int num - Model index.

Return value

World transformation matrix of the model.

Ptr<Mesh> getModelMesh ( int num ) #

Returns the mesh of the given model.

Arguments

  • int num - Model index.

Return value

Model mesh.

Ptr<Texture> getModelTexture ( int num ) #

Returns the texture of the given model.

Arguments

  • int num - Model index.

Return value

Model texture.

const char * getModelName ( int num ) #

Returns the name of the given model.

Arguments

  • int num - Model index.

Return value

Model name.

Ptr<Mesh> getCombinedModelMesh ( ) const#

Returns the entire mesh of the combined model of the VR device.
Notice
You cannot animate this mesh. However, if you get a mesh of each model individually, it will be automatically animated.

Return value

Mesh of the combined model.

Ptr<Texture> getCombinedModelTexture ( ) const#

Returns the texture of the combined model of the VR device.

Return value

Texure of the combined model.

const char * getCombinedModelName ( ) const#

Returns the name of the combined model of the VR device.

Return value

Name of the combined model.
Last update: 2023-12-19
Build: ()