- cleanup state detaching in WoI
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10410 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
8f5a8500a6
commit
cb1920eaff
@ -260,12 +260,10 @@ public class WorldOfInception extends SimpleApplication implements AnalogListene
|
|||||||
return;
|
return;
|
||||||
} else if (currentActiveChild != null && currentActiveChild.getPositionInParent().equals(vector3f)) {
|
} else if (currentActiveChild != null && currentActiveChild.getPositionInParent().equals(vector3f)) {
|
||||||
//TODO: doing this here causes problems when close to multiple pois
|
//TODO: doing this here causes problems when close to multiple pois
|
||||||
logger.log(Level.INFO, "Detach child {0}", currentActiveChild);
|
|
||||||
rootNode.getChild(i).setCullHint(Spatial.CullHint.Inherit);
|
rootNode.getChild(i).setCullHint(Spatial.CullHint.Inherit);
|
||||||
stateManager.detach(currentActiveChild);
|
|
||||||
currentActiveChild = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
checkActiveChild(null);
|
||||||
curScaleAmount = 0;
|
curScaleAmount = 0;
|
||||||
rootNode.setLocalScale(1);
|
rootNode.setLocalScale(1);
|
||||||
rootNode.setLocalTranslation(playerPos.negate());
|
rootNode.setLocalTranslation(playerPos.negate());
|
||||||
@ -276,6 +274,14 @@ public class WorldOfInception extends SimpleApplication implements AnalogListene
|
|||||||
|
|
||||||
private void checkActiveChild(Vector3f vector3f) {
|
private void checkActiveChild(Vector3f vector3f) {
|
||||||
AppStateManager stateManager = application.getStateManager();
|
AppStateManager stateManager = application.getStateManager();
|
||||||
|
if(vector3f == null){
|
||||||
|
if(currentActiveChild != null){
|
||||||
|
logger.log(Level.INFO, "Detach child {0}", currentActiveChild);
|
||||||
|
stateManager.detach(currentActiveChild);
|
||||||
|
currentActiveChild = null;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (currentActiveChild == null) {
|
if (currentActiveChild == null) {
|
||||||
currentActiveChild = new InceptionLevel(this, vector3f);
|
currentActiveChild = new InceptionLevel(this, vector3f);
|
||||||
stateManager.attach(currentActiveChild);
|
stateManager.attach(currentActiveChild);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user