two things -
First have created my own AbstractBaseGame and BaseGame.
in doing so have written an input handler to push all of the show bounds/normals/lights into its own class - similar to KeyboardLookHandler where it uses events.
It makes the initsystem and update methods alot clearer. There is a fair bit of code, will post it up if anyone is interested. the guts are :-
import com.jme.input.InputHandler;
import com.jme.input.KeyInput;
public class DebugableInputHandler extends InputHandler{
protected DebugActionable debugable;
public DebugableInputHandler(DebugActionable debugable) {
super();
this.debugable = debugable;
setKeys();
}
protected void setKeys() {
addAction( new PauseAction(debugable ), "toggle_pause", KeyInput.KEY_P,true );
addAction( new ShowBoundsAction(debugable ), "toggle_bounds",KeyInput.KEY_B, true );
addAction( new NormalsAction(debugable ), "toggle_normals",KeyInput.KEY_N, true );
addAction( new DepthAction(debugable ), "toggle_depth",KeyInput.KEY_F3, true );
addAction( new WireAction(debugable ), "toggle_wire",KeyInput.KEY_T, true );
addAction( new LightsAction(debugable ), "toggle_lights",KeyInput.KEY_L, true );
addAction( new ScreenShotAction(debugable ), "screen_shot",KeyInput.KEY_F1, true );
addAction( new CameraOutAction(debugable ), "camera_out",KeyInput.KEY_C, true );
addAction( new QuitAction(debugable ), "exit",KeyInput.KEY_ESCAPE, true );
}
}
public interface DebugActionable {
public void togglePause();
public void toggleBounds();
public void toggleDepth();
public void toggleLights();
public void toggleNormals();
public void toggleWire();
public void cameraOut();
public void screenShot();
public void finish();
}
Just let simplegame implement the DebugActionable interface and construct the DebugableInputHandler passing in simplegame
The other advantage is that it is easy to enable and disable.
Second point, on stepping through the InputHandler code - the system has to check each action trigger every frame - so the above debugable has 9 actions, keyboard look handler has 8 - thats 17 iterations each frame.
Has anyone got any reasons why the input handler cannot be redone to use a simple cache of actions that require invocation. The update method would only need to test if