Vive Input Utility是一個能夠讓Htc Vive變得更容易開發(fā)的軟件,這個軟件的API參數(shù)不少開發(fā)者可能想知道,來這里看看吧。
API詳解:
uint ViveRole.GetDeviceIndex(DeviceRole role)
返回由role確定的設(shè)備的設(shè)備索引,如果role沒有分配任何設(shè)備的話返回OpenVR.k_unTrackedDeviceIndexInvalid。
bool VivePose.HasFocus()
返回true,如果當(dāng)進程正在運行。通常當(dāng)玩家按下手柄上菜單按鈕切換到steam菜單面板時,進程切換到后臺。
bool VivePose.IsConnected(DeviceRole role)
如果由role定義的設(shè)備被連接了返回true
bool VivePose.HasTracking(DeviceRole role)
如果由role定義的設(shè)備的追蹤數(shù)據(jù)有有效值的時候返回true
Pose VivePose.GetPose(DeviceRole role, Transform origin = null)
返回由role定義的設(shè)備的追蹤pose
void VivePose.SetPose(Transform target, DeviceRole role, Transform origin = null)
設(shè)置目標(biāo)pose來追蹤由role定義的設(shè)備的相對于origin的pose
bool ViveInput.GetPress(HandRole role, ControllerButton button)
當(dāng)控制器上的按鈕被按了的時候返回true
bool ViveInput.GetPressDown(HandRole role, ControllerButton button)
當(dāng)控制器上的按鈕被按下的時候返回true
bool ViveInput.GetPressUp(HandRole role, ControllerButton button)
當(dāng)控制器上的按鈕被松開的時候返回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)
控制器上扳機的震動。