VRTK/SteamVR手柄震动功能
前言
手柄震动功能配合虚拟仿真模块的模拟电击等功能非常方便
代码块
SteamVR_Controller.DeviceRelation.Rightmost是右侧手柄
SteamVR_Controller.DeviceRelation.Leftmost是左侧手柄
csharp
var deviceIndex2 = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Rightmost);
SteamVR_Controller.Input(deviceIndex2).TriggerHapticPulse(5000);
var deviceIndex1 = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost);
SteamVR_Controller.Input(deviceIndex1).TriggerHapticPulse(5000);