Yes. It overrides all default app states that SimpleApplication adds for you… like the FlyCamState. Which is why if you want some of the standard things like StatsAppState, DebugKeysAppState, and BasicProfilerAppState then you have to specify them yourself.
I prefer it this way for my own apps because then I know exactly what I’m adding… and I hate the fly cam JME includes so I get that removed as a bonus.
There is a way around , but it wonot work in all cases , which is making the physics space object public static , if you destruct & recreate the game at the same run , this might not work !
Yes , but because of this way of organizing the game as separate entities , I get OutOfMemoryException raised up when destructing & recreating the game in the same run , despite of doing detach or removing appstates in onDestroy() context , this happens mainly in android !
Attach it when you want your game to run instead of attaching all of the individual app states.
Then verify that everything is removed once you detach it again. Note: some things like “did bullet native code really clean itself up” or “are their any network connections still open” are a little harder to check without being in the debugger. But it’s still possible.
Also note: this only works for applications that attach all of their app states one time and then use enable/disable. It doesn’t work with apps that attach app states at random times… or at least won’t check those states specifically. They have to be checked manually.
No, it won’t interfere with cleanup. If cleanup is a problem then it is a problem even if you don’t call that.
If your app states extend BaseAppState (and they should… they really really really should), then from within the app state you can also call:
getState(BulletAppState.class) directly without the other indirection. It’s a helper method on BaseAppState.
And if you aren’t extending BaseAppState then you are just making your life harder. If you like that sort of thing then I have other suggestions, too.