UNPKG

@dimforge/rapier3d

Version:

3-dimensional physics engine in Rust - official JS bindings.

24 lines 1.15 kB
import { RawPhysicsPipeline } from "../raw"; import { VectorOps } from "../math"; export class PhysicsPipeline { free() { if (!!this.raw) { this.raw.free(); } this.raw = undefined; } constructor(raw) { this.raw = raw || new RawPhysicsPipeline(); } step(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulseJoints, multibodyJoints, ccdSolver, eventQueue, hooks) { let rawG = VectorOps.intoRaw(gravity); if (!!eventQueue) { this.raw.stepWithEvents(rawG, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw, ccdSolver.raw, eventQueue.raw, hooks, !!hooks ? hooks.filterContactPair : null, !!hooks ? hooks.filterIntersectionPair : null); } else { this.raw.step(rawG, integrationParameters.raw, islands.raw, broadPhase.raw, narrowPhase.raw, bodies.raw, colliders.raw, impulseJoints.raw, multibodyJoints.raw, ccdSolver.raw); } rawG.free(); } } //# sourceMappingURL=physics_pipeline.js.map