Prevent double-updating the main scene in VR
This commit is contained in:
parent
ec121f025f
commit
5273045ddf
@ -399,23 +399,11 @@ public class VRAppState extends AbstractAppState {
|
|||||||
environment.getCamera().setFrame(((Spatial)environment.getObserver()).getWorldTranslation(), ((Spatial)environment.getObserver()).getWorldRotation());
|
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 ) {
|
if( environment.isInVR() == false || environment.getVRGUIManager().getPositioningMode() == VRGUIPositioningMode.MANUAL ) {
|
||||||
// only update geometric state here if GUI is in manual mode, or not in VR
|
// 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
|
// it will get updated automatically in the viewmanager update otherwise
|
||||||
spatialIter = application.getGuiViewPort().getScenes().iterator();
|
// TODO isn't this done by SimpleApplication?
|
||||||
spatial = null;
|
for (Spatial spatial : application.getGuiViewPort().getScenes()) {
|
||||||
while(spatialIter.hasNext()){
|
|
||||||
spatial = spatialIter.next();
|
|
||||||
spatial.updateGeometricState();
|
spatial.updateGeometricState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user