From 5273045ddfa147be77d745e05736acbabec49ac3 Mon Sep 17 00:00:00 2001 From: Campbell Suter Date: Sat, 14 Oct 2017 10:01:42 +1300 Subject: [PATCH] Prevent double-updating the main scene in VR --- .../src/main/java/com/jme3/app/VRAppState.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/jme3-vr/src/main/java/com/jme3/app/VRAppState.java b/jme3-vr/src/main/java/com/jme3/app/VRAppState.java index 7dbf7af41..54e7643ce 100644 --- a/jme3-vr/src/main/java/com/jme3/app/VRAppState.java +++ b/jme3-vr/src/main/java/com/jme3/app/VRAppState.java @@ -398,24 +398,12 @@ public class VRAppState extends AbstractAppState { } else if( environment.getObserver() != null ) { environment.getCamera().setFrame(((Spatial)environment.getObserver()).getWorldTranslation(), ((Spatial)environment.getObserver()).getWorldRotation()); } - - //FIXME: check if this code is necessary. - // Updates scene and gui states. - Iterator spatialIter = getLeftViewPort().getScenes().iterator(); - Spatial spatial = null; - while(spatialIter.hasNext()){ - spatial = spatialIter.next(); - spatial.updateLogicalState(tpf); - spatial.updateGeometricState(); - } if( environment.isInVR() == false || environment.getVRGUIManager().getPositioningMode() == VRGUIPositioningMode.MANUAL ) { // only update geometric state here if GUI is in manual mode, or not in VR // it will get updated automatically in the viewmanager update otherwise - spatialIter = application.getGuiViewPort().getScenes().iterator(); - spatial = null; - while(spatialIter.hasNext()){ - spatial = spatialIter.next(); + // TODO isn't this done by SimpleApplication? + for (Spatial spatial : application.getGuiViewPort().getScenes()) { spatial.updateGeometricState(); } }