@dimforge/rapier3d
Version:
3-dimensional physics engine in Rust - official JS bindings.
32 lines • 936 B
JavaScript
import { RawIslandManager } from "../raw";
/**
* The CCD solver responsible for resolving Continuous Collision Detection.
*
* To avoid leaking WASM resources, this MUST be freed manually with `ccdSolver.free()`
* once you are done using it.
*/
export class IslandManager {
/**
* Release the WASM memory occupied by this narrow-phase.
*/
free() {
if (!!this.raw) {
this.raw.free();
}
this.raw = undefined;
}
constructor(raw) {
this.raw = raw || new RawIslandManager();
}
/**
* Applies the given closure to the handle of each active rigid-bodies contained by this set.
*
* A rigid-body is active if it is not sleeping, i.e., if it moved recently.
*
* @param f - The closure to apply.
*/
forEachActiveRigidBodyHandle(f) {
this.raw.forEachActiveRigidBodyHandle(f);
}
}
//# sourceMappingURL=island_manager.js.map