string GetViveDeviceName(int deviceID) { if (deviceID == 0) { return("hmd"); } CognitiveVR_Manager.ControllerInfo cont = CognitiveVR_Manager.GetControllerInfo(deviceID); if (cont != null) { return(cont.isRight ? "right controller" : "left controller"); } return("unknown id " + deviceID); }
private void OnPadClicked(object sender, ClickedEventArgs e) { var padTransaction = new CustomEvent("cvr.input"); CognitiveVR_Manager.ControllerInfo cont = CognitiveVR_Manager.GetControllerInfo((int)e.controllerIndex); if (cont == null) { return; } Vector3 pos = CognitiveVR_Manager.GetControllerPosition(cont.isRight); padTransaction.SetProperties(new Dictionary <string, object> { { "type", "pad" }, { "device", cont.isRight?"right controller":"left controller" }, { "x", e.padX }, { "y", e.padY } }); padTransaction.Send(pos); }
void OnTriggerUnclicked(object sender, ClickedEventArgs e) { CognitiveVR_Manager.ControllerInfo cont = CognitiveVR_Manager.GetControllerInfo((int)e.controllerIndex); EndTransaction("trigger" + e.controllerIndex, "trigger", cont.isRight); }
private void OnUngripped(object sender, ClickedEventArgs e) { CognitiveVR_Manager.ControllerInfo cont = CognitiveVR_Manager.GetControllerInfo((int)e.controllerIndex); EndTransaction("grip" + e.controllerIndex, "grip", cont.isRight); }