ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
357 stars 81 forks source link

Vive Focus UGUI Interaction not working #93

Closed codest19 closed 5 years ago

codest19 commented 5 years ago

I tested VIU just before this 1.10.3 update and everything was working fine with the Wave SDK and pushing to the Focus. Now the clicking interactions stopped working, even in the example scene 1.UGUI. The different UI elements do respond to PointerEnter and PointerExit but no clicks with either trigger or pad. Double checked everything, tried the latest version of Unity(previously used 2018.2.7f1 as per Oculus recommeds, the updated version was 2018.3.6f1), using the Wave simulator from the editor, pushing apk to device, nothing worked. I had to go back to 1.10.2 for a pushed apk to work.

chengnay commented 5 years ago

Which version of WaveVR SDK are you using?

codest19 commented 5 years ago

Wave SDK version 2.1.8

chengnay commented 5 years ago

@codest19 I just tried a clean project with Unity 2018.3.5 and install VIU v1.10.3 and WaveVR 2.1.8, I don't seem to have the issue you mentioned. Could you provide more details(Preference settings/Player settings... etc) or share your project to me? At the same time, can you also try making a new project? Thanks!

codest19 commented 5 years ago

ProjectSettings.zip

I tried again. Using unity 2018.3.6f1 and Wave SDK 2.1.8, I deleted VIU files then imported VIU 1.10.3. The same issue happened, OnPointerEnter and OnPointerExit work but any click events do not, all while in the 1.UGUI example scene with Vive Focus checked in the VIU settings. I then deleted VIU again and imported version 1.10.2 and it works properly. I've attached my project settings for you to look at.

I do have Oculus SDKs in the project if that would effect anything. I'm trying to port a Gear/Go project to Focus.

chengnay commented 5 years ago

@codest19 What's the version of Oculus SDK you have in the project? I just tried having both WaveVR and Oculus SDKs in the same project, but it doesn't have any issue with pointer event. Can you try a clean project with only WaveVR SDK and VIU 1.10.3 to check whether you still have the same issue occurs? If you still do, please send me the whole project for further investigation, thanks!

frg-kova commented 5 years ago

Possibly related to my issue I just opened https://github.com/ViveSoftware/ViveInputUtility-Unity/issues/94 If that's it, It's solved by comparing by depth before distance, detailed explanation there.

chengnay commented 5 years ago

Possibly related to my issue I just opened

94

If that's it, It's solved by comparing by depth before distance, detailed explanation there.

I think @frg-kova issue might not be the same as @codest19's issue. @codest19 Could you try creating a new project with ONLY WaveVR SDK and VIU 1.10.3 to double check the issue will exist or not? Thanks!

codest19 commented 5 years ago

Thanks for the suggestion @frg-kova but that wasn't it.

I tried deleting all the oculus files from the project, VIU 1.10.3, WaveSDK 2.1.8, Unity 2018.3.3f1 and the same issue was there, so probably not an Oculus issue. I opened a new project, Unity 2018.3.3f1, VIU 1.10.3, WaveSDK 2.1.8, opened the UGUI test scene and Unity crashed upon hitting the play button. The simulator was running on the focus, and the simulator was working in the previous project without crashes, just the interaction issue.

Is there a certain version of Java Dev kit required?

chengnay commented 5 years ago

@codest19 Could you send us the Unity log that has the crash log? Right click on the Console and select "Open Editor Log". image

Could you try running the simulator again and see if you are still getting the crash from Unity? If you still do, please try the below steps, Click on the "Repair Define Symbols" on VIU Settings. image Sometimes, Unity might have compile issue, I just ran into the crash issue too, but after I tried the above steps, it works fine now!

Note: In Focus Simulator, the controller's button events is not supported in WaveVR 2.1.8. Does your issue happens in Simulator?

codest19 commented 5 years ago

Upon re-opening the project VIU Settings didn't have Vive Focus interactable. I did the Repair Define Symbols and Vive Focus was interactable again. Having it selected, and all the same versions and settings as before, it crashed still with the Focus running the simulator and pressing play. I've attached the Unity crash report. Crash_2019-03-04_182616506.zip

codest19 commented 5 years ago

Hey @chengnay have you had a chance to look at the crash log?

chengnay commented 5 years ago

@codest19 I know where it crashes but I need WaveVR SDK team to support to fix this issue. I will get back to you ASAP when I have the solution. Sorry for the late reply.

codest19 commented 5 years ago

No problem, thanks for the update.

chengnay commented 5 years ago

@codest19 I will provide you with a quick fix. Please modify your code as follows,

In WaveVRModule.cs line 537,

if VIU_WAVEVR_2_1_0_OR_NEWER && UNITY_EDITOR

        if (!WaveVR.Instance.isSimulatorOn || WaveVR_Utils.WVR_GetDegreeOfFreedom_S(_**(int)WVR_DeviceType.WVR_DeviceType_HMD**_) == (int)WVR_NumDoF.WVR_NumDoF_6DoF) { return; }

else

In WaveVR_Utils.cs line 544, [DllImport("WaveVR_Simulator", EntryPoint = "WVR_GetDegreeOfFreedom_S")] public static extern int WVR_GetDegreeOfFreedomS(int WVR_DeviceType_);

This fix needs to modify code in both VIU and WaveVR SDK, we will wait until WaveVR SDK roll out the latest version with this fix then VIU will update in next release.

Cheers :)

codest19 commented 5 years ago

Thank you @chengnay It doesn't crash now. The simulator does run. And a build does interact with UI normally.