June 2013
Beginner
352 pages
9h 5m
English
To activate the mappings, you have to register them to an InputListener object. The jMonkeyEngine offers several InputListener objects in the com.jme3.input.controls.* package. Let's create instances of the two most common InputListener objects and compare what they do.
simpleInitApp() method, add the following code snippet:private ActionListener actionListener = new ActionListener() { public void onAction(String name, boolean isPressed, float tpf) { System.out.println("You triggered: "+name); } }; private AnalogListener analogListener = new AnalogListener() { public void onAnalog(String name, float intensity, float tpf) { System.out.println("You triggered: ...Read now
Unlock full access