chiepomme Posted November 22, 2018 Share Posted November 22, 2018 With WaveVR Simulator in Vive Focus SDK v2.1.8, it seems that I can't use any button on controller.I noticed the simulator component on unity just ignores input events from connected simulator. So, I wrote a patch for this problem. --- a/Assets/WaveVR/Scripts/TrackingPose/WaveVR_PoseSimulator.cs+++ b/Assets/WaveVR/Scripts/TrackingPose/WaveVR_PoseSimulator.cs@@ -40,6 +40,34 @@ void OnEnable() pose_right.pose.Velocity.v0 = 0.1f; pose_right.pose.Velocity.v1 = 0.0f; pose_right.pose.Velocity.v2 = 0.0f;++ WaveVR_Utils.Event.Listen(WaveVR_Utils.Event.ALL_VREVENT, OnEvent);+ }++ void OnDisable()+ {+ WaveVR_Utils.Event.Remove(WaveVR_Utils.Event.ALL_VREVENT, OnEvent);+ }++ void OnEvent(object[] args)+ {+ var ev = (WVR_Event_t)args[0];++ switch (ev.common.type)+ {+ case WVR_EventType.WVR_EventType_ButtonPressed:+ btn_right.BtnPressed |= 1UL << (int)ev.input.inputId;+ break;+ case WVR_EventType.WVR_EventType_ButtonUnpressed:+ btn_right.BtnPressed &= ~(1UL << (int)ev.input.inputId);+ break;+ case WVR_EventType.WVR_EventType_TouchTapped:+ btn_right.BtnTouched |= 1UL << (int)ev.input.inputId;+ break;+ case WVR_EventType.WVR_EventType_TouchUntapped:+ btn_right.BtnTouched &= ~(1UL << (int)ev.input.inputId);+ break;+ } } public WVR_Vector3f_t GetVelocity(WVR_DeviceType type) Link to comment Share on other sites More sharing options...
Tony PH Lin Posted November 22, 2018 Share Posted November 22, 2018 Hi , Thanks for this feedback. WaveVR_PoseSimulator.cs is originally designed for mouse controller in editor mode. We'll considerate to enhance this for the next update. Link to comment Share on other sites More sharing options...
chiepomme Posted November 26, 2018 Author Share Posted November 26, 2018 Thank you for your reply! I've understood WaveVR_PoseSimulator.cs is intended to simulate with mouse. I'm so happy if VIVE team considers the feature like this :smileyhappy: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.