Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 static void Translate(float deltaSeconds, PathSteering steering, ref Translation translation)
 => translation.Value += steering.CurrentHeading * TRANSLATION_SPEED * deltaSeconds;