google-ar / arcore-unreal-sdk

ARCore SDK for Unreal
https://developers.google.com/ar/
Apache License 2.0
277 stars 122 forks source link

AR Core not working alongside Google VR #39

Open dradix opened 5 years ago

dradix commented 5 years ago

They work fine alone, but ARCore returns unsupported when used in the same PROJECT with Google VR. NOT in the same level, just in the same project.

bopangzz commented 5 years ago

What are you trying to achieve here using both plugins? Currently, they will not work together in Unreal since they talk to the same Unreal interface which could causes some conflict.

dradix commented 5 years ago

I'm trying to make and app with 2 levels: First with only AR, second with only VR Cardboard. Is there a way I can separate this interface you mentioned from unreal engine source code? Is this a ArCore/GoogleVR limitation, or an UE implementation limitation? Thanks.

bopangzz commented 5 years ago

I will have to look into this. Both ARCore and GoogleVR plugins uses the HeadMountedDisplay interface, and if I remember correctly, Unreal only active one module that implemented the HeadMountedDisplay interface. Which one is used is based on their priority. You probably could modify the Engine code to toggle which module is active.

dradix commented 5 years ago

Thanks for the answer. Do you think is possible for you to provide some hint about where in the code this decision is made?

bopangzz commented 5 years ago

I probably can take a look sometime next week. I will post what I find here.

dradix commented 5 years ago

Thank you very much. I really appreciate that.

bopangzz commented 5 years ago

So I took some time dig in to the engine code and I found that it is not an easy things to do. If you look at the UnrealEngine.cpp, you will find that it only initialize one XRSystem that has the highest priority when the Engine is initializing. To achieve what you requested, we will need to modify the Engine to support multiple XRSystem and be able to switch which one to use. I will put this as a feature request but I can't guarantee we could resolve this in near term.

dradix commented 5 years ago

Thank you very much for your time. I'll take a look that file to see if I can figure out something. I'll also look forward to the feature.