Function angleFromAccelerationForce

Yields a force function that applies the thing's acceleration.x to its angular acceleration.

  • Parameters

    • scaling: number = 20

      Use this to scale the accel.x value. Defaults to 20 (ie accel.x*20). Adjust if rotation is too much or too little

    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;
        }>