UNPKG

blaze-2d

Version:

A fast and simple WebGL 2 2D game engine written in TypeScript

20 lines 559 B
import Space from "./space"; /** * Contains {@link Constraint}s involving {@link CollisionObject}s. */ export default class ConstraintSpace extends Space { /** * Executes a solver on every object in the space. * * @param id The id of the solver to execute */ solve(id, delta) { const solver = this.solvers[id]; for (let i = 0; i < solver.iterations; i++) { for (const obj of this.objects) { solver.cb(obj, delta); } } } } //# sourceMappingURL=constraints.js.map