I’m looking to disable the flycam ZoomIn/ZoomOut mappings - and haven’t had any luck.
I’ve searched the forums and looked at the inputmanager/flycam source and everything leads to calling:
[java]inputManager.deleteMapping(“FLYCAM_ZoomIn”);
inputManager.deleteMapping(“FLYCAM_ZoomOut”); [/java]
But this fails with
[java]java.lang.IllegalArgumentException: Cannot find mapping: FLYCAM_ZoomIn[/java]
and
[java]java.lang.IllegalArgumentException: Cannot find mapping: FLYCAM_ZoomOut[/java]
unfortunately you can’t call that in simpleInitApp anymore, search the forum/docs for FlyCamAppstate. It is because the flycam is initialised in an appstate, where the following is called:
so the mappings won’t be available until the next frame.
Either:
Make your own specialised Flycam, FlyCamAppstate or create another appstate and do your initialising inside the initialize method and attach that in simpleInitApp. There may be other ways
yeh, that is a possibility (and i’ve done it myself ^_^) but then you would be checking for something the rest of the whole game session which is never gonna happen again. While it is a cheap operation, I’d prefer something like an initializing appstate/control, which you can then detach afterwards.
You can also move everything you have in simpleInit and simpleUpdate into a “MyGame” app state and leave your SimpleApplication clean. You don’t have to have a simpleInit or simpleUpdate at all in that case (unless you want to attach the state in simpleInit(). And the camera will have been initialized by the time the app state’s init is called presuming it was added after fly cam’s app state.