summaryrefslogtreecommitdiff
path: root/engine/components/Forces.ts
blob: 91ae1c13a518ba6560b592bcb5d0ae31556c4827 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import type { Force2D } from "../interfaces";
import { Component } from "./Component";
import { ComponentNames } from ".";

/**
 * A list of forces and torque, (in newtons, and newton-meters respectively)
 * to apply on one Physics system update (after which, they are cleared).
 */
export class Forces extends Component {
  public forces: Force2D[];

  constructor(forces?: Force2D[]) {
    super(ComponentNames.Forces);

    this.forces = forces ?? [];
  }
}