static void Rotate(float deltaSeconds, PathSteering steering, Translation translation, ref Rotation rotation) { var lookAt = steering.CurrentHeading; lookAt.y = translation.Value.y; var lookRotation = quaternion.LookRotationSafe(lookAt - translation.Value, math.up()); rotation.Value = math.slerp(rotation.Value, lookRotation, deltaSeconds / ROTATION_SPEED); }
static void Translate(float deltaSeconds, PathSteering steering, ref Translation translation) => translation.Value += steering.CurrentHeading * TRANSLATION_SPEED * deltaSeconds;