ixfx
    Preparing search index...

    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.

      Type Parameters

      Parameters

      • interpolateAmt: number = 1

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

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

      A function that can be applied to a thing to set its angle based on its velocity