跑跑车游戏网
游戏
网游单机小游戏专题排行榜攻略资讯评测
软件
11应用专题排行榜教程
关于
广告合作网站地图意见反馈

Vive Input Utility API代码参数整理

不详2016/10/12评论 (0)

Vive Input Utility是一个能够让Htc Vive变得更容易开发的软件,这个软件的API参数不少开发者可能想知道,来这里看看吧。

API详解:

uint ViveRole.GetDeviceIndex(DeviceRole role)

返回由role确定的设备的设备索引,如果role没有分配任何设备的话返回OpenVR.k_unTrackedDeviceIndexInvalid。

bool VivePose.HasFocus()

返回true,如果当进程正在运行。通常当玩家按下手柄上菜单按钮切换到steam菜单面板时,进程切换到后台。

bool VivePose.IsConnected(DeviceRole role)

如果由role定义的设备被连接了返回true

bool VivePose.HasTracking(DeviceRole role)

如果由role定义的设备的追踪数据有有效值的时候返回true

Pose VivePose.GetPose(DeviceRole role, Transform origin = null)

返回由role定义的设备的追踪pose

void VivePose.SetPose(Transform target, DeviceRole role, Transform origin = null)

设置目标pose来追踪由role定义的设备的相对于origin的pose

bool ViveInput.GetPress(HandRole role, ControllerButton button)

当控制器上的按钮被按了的时候返回true

bool ViveInput.GetPressDown(HandRole role, ControllerButton button)

当控制器上的按钮被按下的时候返回true

bool ViveInput.GetPressUp(HandRole role, ControllerButton button)

当控制器上的按钮被松开的时候返回true

float ViveInput.GetTriggerValue(HandRole role)

返回扳机键的原始的模拟量

Vector2 ViveInput.GetPadAxis(HandRole role)

返回touchpad上的原始模拟量

int ViveInput.ClickCount(HandRole role, ControllerButton button)

返回按钮连续点击的次数。查看ViveInput.clickInterval来获取点击间隔时间

float ViveInput.LastPressDownTime(HandRole role, ControllerButton button)

返回用户按下按钮的最后一帧的时间

void ViveInput.AddPress(HandRole role, ControllerButton button, Action callback)

void ViveInput.AddPressDown(HandRole role, ControllerButton button, Action callback)

void ViveInput.AddPressUp(HandRole role, ControllerButton button, Action callback)

void ViveInput.AddClick(HandRole role, ControllerButton button, Action callback)

void ViveInput.RemovePress(HandRole role, ControllerButton button, Action callback)

void ViveInput.RemovePressDown(HandRole role, ControllerButton button, Action callback)

void ViveInput.RemovePressUp(HandRole role, ControllerButton button, Action callback)

void ViveInput.RemoveClick(HandRole role, ControllerButton button, Action callback)

添加和移除press、pressdown、pressup、click的监听事件

void ViveInput.TriggerHapticPulse(HandRole role, ushort intensity = 500)

控制器上扳机的震动。

上一篇Vive Input Utility详细使用指南

下一篇Htc Vive用控制器实现推拉门方法

网友评论
取消

累计评论0

展开其余评论

相关阅读

上滑或点击查看更多...