// TODO: vanilla input
@Override
public void onTick(float dt) {
Player player = (Player) getOwner();
Transform ts = player.getPhysics().getTransform();
PlayerInputState inputState = player.input();
PhysicsComponent sc = player.getPhysics();
Vector3f offset = Vector3f.ZERO;
float speed = 50;
if (inputState.getForward()) {
offset = offset.sub(ts.forwardVector().mul(speed * dt));
}
if (inputState.getBackward()) {
offset = offset.add(ts.forwardVector().mul(speed * dt));
}
if (inputState.getLeft()) {
offset = offset.sub(ts.rightVector().mul(speed * dt));
}
if (inputState.getRight()) {
offset = offset.add(ts.rightVector().mul(speed * dt));
}
if (inputState.getJump()) {
offset = offset.add(ts.upVector().mul(speed * dt));
}
if (inputState.getCrouch()) {
offset = offset.sub(ts.upVector().mul(speed * dt));
}
player.get(EntityHead.class).setOrientation(Quaternionf.fromAxesAnglesDeg(inputState.pitch(), inputState.yaw(), ts.getRotation().getAxesAngleDeg().getZ()));
player.getPhysics().translate(offset);
player.getPhysics().setRotation(Quaternionf.fromAxesAnglesDeg(inputState.pitch(), inputState.yaw(), ts.getRotation().getAxesAngleDeg().getZ()));
}