chore: 添加第三方依赖库
This commit is contained in:
37
thirdparty/rapier.js/src.ts/dynamics/island_manager.ts
vendored
Normal file
37
thirdparty/rapier.js/src.ts/dynamics/island_manager.ts
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import {RawIslandManager} from "../raw";
|
||||
import {RigidBodyHandle} from "./rigid_body";
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
raw: RawIslandManager;
|
||||
|
||||
/**
|
||||
* Release the WASM memory occupied by this narrow-phase.
|
||||
*/
|
||||
public free() {
|
||||
if (!!this.raw) {
|
||||
this.raw.free();
|
||||
}
|
||||
this.raw = undefined;
|
||||
}
|
||||
|
||||
constructor(raw?: RawIslandManager) {
|
||||
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.
|
||||
*/
|
||||
public forEachActiveRigidBodyHandle(f: (handle: RigidBodyHandle) => void) {
|
||||
this.raw.forEachActiveRigidBodyHandle(f);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user