Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 796 Bytes

create-a-state-machine.md

File metadata and controls

19 lines (16 loc) · 796 Bytes

How to create a Model State Machine

One creates a state machine in jMonkeyEngine using the following:

ModelStateMachine modelStateMachine = new ModelStateMachine();
spatial.addControl(modelStateMachine);

To add a layer, one needs to set the default state.

Layer modelBaseLayer = new Layer();
modelStateMachine.addLayer(modelBaseLayer);
modelBaseLayer.setInitialState(new IdleState());

How to create a state like the IdleState, is explained in the chapter about State. More information on Layers is explained on the Layers docs


Next Topic: State