Vuforia SDK Version: 6.0.117 -
Description with steps to reproduce: I've been fighting with this one for a week..trying to brute force fix it...but so far I've not been able to and I really need this to work.
ARCamera has a flag for world center mode. In a general sense, among other things, this lets you decide what will be moving around in the scene...the camera or the image target. If you center on the camera for example, when tracking occurs the image target will be flying around in your scene to align itself. If you choose first_target, the image target will not move, but the camera will...to accomplish the same illusion. Depending on what you're making, this can be important or not important.
In many projects, such as this one...it's important. For example if you need to depend on gravity in your scene, particle systems that must run in world-space (as opposed to local-space), having certain objects set as static for perf reasons or for leveraging enlighten, etc. I could make a longer list, but you get the idea.
So what's the actual issue here...
- Setup a project for Mixed Reality switching...ie switch from some AR thing, to a VR thing. For example you're looking at a house on your desk, in AR. And presto...now you're in the house in VR. Yay.
- Use first_target, or any mode in which the ImageTarget isn't the one that is moving.
- Start in AR...all is well.
- Switch to VR....all is well.
- Switch back to AR....everything is fubar. Why? It seems Vuforia is now in Camera mode. The imageTarget is flying around the scene to align itself. So anything you had marked as static...isn't flying with it...because it can't. Any systems that depend on a genuine world space orientation are all acting bizarre for obvious reason.
The reason I'm putting this in the bug section is that, if you inspect the Vuforia object during this time, it still reports that it is in First_Target...just like you set it up. But it's behaving in Camera mode anyway. Also, regardless of what it reported, it shouldn't be returning to AR in a mode that is different from the correct mode.
Some things I have tried...
- At first I figured...big deal...I'll just catch Vuforia after the transition Vuforia to change to First_Target, regardless of the fact it thinks it's already there. This works great in the editor, but not on any device.
- Then I got more aggressive...after the transition, I disable vuforia, restart it, force First_Target. Still doesn't work on the device.
- Finally...the button that switches back to AR...I just attached it to a method that reloads the same scene...which of course works...but is horrible.
The sample exposes this issue, but you can't see it because the sample doesn't do anything except render a few models. So...if the camera is locked or the target is locked doesn't make any difference...to the user it looks the same. But you can use the sample to verify this in the editor easily.
- Load up the sample
- edit the ARCamera to use First_Target
- Start it up. Move stuff around...notice the ImageTarget isn't moving. By default, the sample has it the other way...but we changed it just now to First_Target.
- Go VR.
- Using the scene view, grab the head and rotate it down to see the button (we must do this since we are in the editor and not on a device). After a moment it will trigger the AR switch.
- Now we're in AR again. The ARCamera reports First_Target, but the camera isn't moving anymore...the ImageTarget is.
Perhaps this behavior is simply a default behavior....and the presence of some additional code will inform Vuforia what to fall back to in AR...if this is the case please paste that code here. -
Development OS (Mac OS X, Windows, Linux): all -
Mobile OS and Version: all -
Mobile Device Manufacturer and Model name: all -
Do the Vuforia Sample Applications show the same behavior?: Yep.