}
Vector2i deltaMouse = mouse.getDelta();
//process mouse movement x axis
if (deltaMouse.x != 0) {
MouseAxisEvent event = new MouseXAxisEvent(deltaMouse.x * config.getInput().getMouseSensitivity(), delta);
setupTarget(event);
for (EntityRef entity : getInputEntities()) {
entity.send(event);
if (event.isConsumed()) {
break;
}
}
}
//process mouse movement y axis
if (deltaMouse.y != 0) {
int yMovement = config.getInput().isMouseYAxisInverted() ? deltaMouse.y * -1: deltaMouse.y;
MouseAxisEvent event = new MouseYAxisEvent(yMovement * config.getInput().getMouseSensitivity(), delta);
setupTarget(event);
for (EntityRef entity : getInputEntities()) {
entity.send(event);
if (event.isConsumed()) {
break;
}
}
}