跑跑車游戲網(wǎng)
您的位置:首頁VR資訊中心VR技術(shù)教程 → Vive Input Utility API代碼參數(shù)整理

Vive Input Utility API代碼參數(shù)整理

2016/10/12 8:48:39來源:本站整理作者:不詳我要評論(0)

Vive Input Utility是一個能夠讓Htc Vive變得更容易開發(fā)的軟件,這個軟件的API參數(shù)不少開發(fā)者可能想知道,來這里看看吧。

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定義的設備的追蹤數(shù)據(jù)有有效值的時候返回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)

返回按鈕連續(xù)點擊的次數(shù)。查看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的監(jiān)聽事件

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

控制器上扳機的震動。

網(wǎng)友評論

發(fā)表評論

(您的評論需要經(jīng)過審核才能顯示)

查看所有0條評論>>