設備認識
手柄
設備接口
Action類型
bool、vector1、vector2、vector3、pose、skeleton
bool
既然是按鍵自然有按下,擡起,一直按,雙擊
菜單,電源,扳機都是bool值
Vector1
2019年4月15日13:57:13
抱歉這個暫時不知道怎麼用,如果你知道可以告訴我。
Vector2
觸控板也是觸控鍵,二維座標,很好理解
Vector3
三維座標,可以理解爲手柄的位置,和頭顯位置。
Pose
2019年4月15日13:57:13
抱歉這個暫時不知道怎麼用,如果你知道可以告訴我。
skeleton
猜測跟骨胳手有關係,還是暫時沒用過,畢竟剛學
ActionSet動作集
屬於包含關係
動作集包含動作,而動作包含動作類型
如同下圖,
default platformer buggy 都是動作集,
interactUI teleport grabpinch move 都是動作
這兩個可以自定義,而動作類型不行
bool vector2 pos
OpenBindingUI
SteamVR Input窗口。點擊OpenBindingUI。會自動瀏覽器打開綁定界面,前期打開steam,與連接vive設備
會看到跟Unity裏邊一樣的屬性
手柄按鍵檢測
以前這樣檢測手柄
2.0這樣
private Hand hand;
private SteamVR_Input_Sources handType;
//扳機
public SteamVR_Action_Boolean trrigerKey = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("default", "GrabPinch");
//握持
public SteamVR_Action_Boolean gripKey;
//觸控
public SteamVR_Action_Boolean touchPadKey;
void Start()
{
hand = GetComponent<Hand>();
handType = hand.handType;
}
// Update is called once per frame
void Update()
{
if(trrigerKey.GetStateDown(handType))
{
Debug.Log(handType + "扳機按下");
}
if (gripKey[handType].stateDown)
{
Debug.Log(handType + "握持按下");
}
if (touchPadKey.GetStateDown(handType))
{
Debug.Log(handType + "觸控按下 ");
}
}
腳本掛到手上
我發現steamvr檢測輸入有多種方式,以及獲取動作,
目前還有輸入,我並不懂,pose vector1 跟骨胳,如果以後明白,後期會修改博客。
下幾篇,講解。傳送,射線等