// create our manager
manager = new InteractManager();
manager.setupInput(_canvas, _physicalLayer, _logicalLayer);
// final add our widget
final CompoundInteractWidget widget = new CompoundInteractWidget()
.withMoveXAxis(new ColorRGBA(1, 0, 0, .65f), 1.2, .15, .5, .2)
.withMoveZAxis(new ColorRGBA(0, 0, 1, .65f), 1.2, .15, .5, .2) //
.withRotateYAxis() //
.withPlanarHandle(MovePlane.XZ, new ColorRGBA(1, 0, 1, .65f)) //
.withRingTexture((Texture2D) TextureManager.load("images/tick.png", MinificationFilter.Trilinear, true));
// widget.getHandle().setRenderState(_lightState);
manager.addWidget(widget);
manager.setActiveWidget(widget);
// add toggle for matrix mode on widget
manager.getLogicalLayer().registerTrigger(new InputTrigger(new KeyPressedCondition(Key.R), new TriggerAction() {
@Override
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
widget.setInteractMatrix(widget.getInteractMatrix() == InteractMatrix.World ? InteractMatrix.Local
: InteractMatrix.World);
widget.targetDataUpdated(manager);
}
}));
// add a filter
manager.addFilter(new TerrainHeightFilter(terrain, 20));