Type Alias ForceAffected

ForceAffected: {
    acceleration?: Point;
    angle?: number;
    angularAcceleration?: number;
    angularVelocity?: number;
    mass?: number;
    position?: Point;
    velocity?: Point;
}

Basic properties of a thing that can be affected by forces

Type declaration

  • Optional Readonlyacceleration?: Point

    Acceleration vector. Most applied forces will alter the acceleration, culminating in a new velocity being set and the acceleraton value zeroed

  • Optional Readonlyangle?: number
  • Optional ReadonlyangularAcceleration?: number
  • Optional ReadonlyangularVelocity?: number
  • Optional Readonlymass?: number

    Mass. The unit is undefined, again best to think of this being on a 0..1 scale. Mass is particularly important for the attraction/repulsion force, but other forces can incorporate mass too.

  • Optional Readonlyposition?: Point

    Position. Probably best to use relative coordinates

  • Optional Readonlyvelocity?: Point

    Velocity vector. Probably don't want to assign this yourself, but rather have it computed based on acceleration and applied forces