UNPKG

constraint-solver-js

Version:

2D rigid body constraint solver written in typescript.

19 lines (18 loc) 438 B
/** * Represents a rigid body */ export class Body { /** * Body constructor * @param id body id. No two bodies should have the same ID. * @param x Body's center of mass x position * @param y Body's center of mass y position * @param theta Body's rotation in radians */ constructor(id, x, y, theta) { this.id = id; this.x = x; this.y = y; this.theta = theta; } }