public void onStopMoving(StopMovingEvent stopMove)
{
// we need to inform the connected clients and
// set the movement state to notmoving
Entity et = stopMove.getThisEntity();
// update the movement component of the entity
// note that as the entity is not moving anymore,
// its future position is the position it has already reached!
// this is necessary because the update movement view will send the future position
Position pos = et.get(Position.class);
Direction dir = et.get(Direction.class);
Movement move = et.get(Movement.class);
Vector2 direction1 = pos.position.vecWithEndpoint(move.moveAim);
float angle = direction1.angleTo(dir.direction);