Function angleFromVelocityForce

Yields a force function that applies the thing's velocity to its angle. This will mean it points in the direction of travel.

  • Parameters

    • interpolateAmt: number = 1

      If provided, the angle will be interpolated toward by this amount. Defaults to 1, no interpolation

    Returns ((t: ForceAffected) => Readonly<{
        acceleration?: Point;
        angle: number;
        angularAcceleration?: number;
        angularVelocity?: number;
        mass?: number;
        position?: Point;
        velocity?: Point;
    }>)

      • (t): Readonly<{
            acceleration?: Point;
            angle: number;
            angularAcceleration?: number;
            angularVelocity?: number;
            mass?: number;
            position?: Point;
            velocity?: Point;
        }>
      • Parameters

        Returns Readonly<{
            acceleration?: Point;
            angle: number;
            angularAcceleration?: number;
            angularVelocity?: number;
            mass?: number;
            position?: Point;
            velocity?: Point;
        }>