跑跑车游戏网
您的位置:首页VR资讯中心VR技术教程 → Vive Input Utility API代码参数整理

Vive Input Utility API代码参数整理

2016/10/12 8:48:39来源:本站整理作者:不详我要评论(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)

控制器上扳机的震动。

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>