Merge pull request #755 from ZNixian/master

Prevent double-updating the main scene in VR
empirephoenix-patch-1
Rickard Edén 7 years ago committed by GitHub
commit eb6ce4d4b4
  1. 16
      jme3-vr/src/main/java/com/jme3/app/VRAppState.java

@ -399,23 +399,11 @@ public class VRAppState extends AbstractAppState {
environment.getCamera().setFrame(((Spatial)environment.getObserver()).getWorldTranslation(), ((Spatial)environment.getObserver()).getWorldRotation());
}
//FIXME: check if this code is necessary.
// Updates scene and gui states.
Iterator<Spatial> 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();
}
}

Loading…
Cancel
Save