-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removeAllSceneObjects() is detaching the Camera Rig #1755
Comments
Actually, it's also hitting the controller, here's an updated workaround fix: --- a/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRScene.java
|
Here is my version of removeAllSceneObjects. Yes, it does remove the controller model at first. But the selectControllers() call should put the controller back. Does it do that for your application? public void removeAllSceneObjects() {
|
Your function is okay with the way it puts the controller back, the trouble is the master version has added a new call to child.detachAllComponents(); which yours doesn't have, that's the bit that's causing the problem. I assume it was added for a good reason, but it needs protection to stop it detaching components from the Controller & Camera Rig. |
We have shutdown issues because of the way Java and C++ objects interact. I think we will have to do without detatchAllComponents there. |
I think detachAllComponent's problem is the bi-directional link a SceneObject and its components have more than anything else. |
This problem is on the master branch.
GVRScene.removeAllSceneObjects() was recently changed with the addition of a call to child.detachAllComponents(); on each child object being removed. This is causing a problem as the main GVRCameraRig is being detached from it's owner object. This causes GVRCameraRig .getTransform() to return null triggering NullPointerException's.
I've made this change to my build which has fixed the problem for me:
The text was updated successfully, but these errors were encountered: