} else {
endVelocity.y = Math.max(-TERMINAL_VELOCITY, state.getVelocity().y - (GRAVITY * movementComp.mode.scaleGravity) * input.getDelta());
}
Vector3f moveDelta = new Vector3f(endVelocity);
moveDelta.scale(input.getDelta());
CharacterCollider collider = movementComp.mode.useCollision ? physics.getCharacterCollider(entity) : null;
MoveResult moveResult = move(state.getPosition(), moveDelta,
(state.getMode() != MovementMode.CLIMBING && state.isGrounded() && movementComp.mode.canBeGrounded) ? movementComp.stepHeight : 0,
movementComp.slopeFactor, collider);
Vector3f distanceMoved = new Vector3f(moveResult.getFinalPosition());
distanceMoved.sub(state.getPosition());