jumpstorm/engine/components/Forces.ts

18 lines
461 B
TypeScript
Raw Permalink Normal View History

2023-08-25 18:48:17 -04:00
import type { Force2D } from '../interfaces';
import { Component } from './Component';
import { ComponentNames } from '.';
2023-07-19 23:38:24 -04:00
/**
* 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 ?? [];
}
}