@rzmps/ammo
v2.0.0
Published
Ammo physics engine extension for rzmps.
Downloads
722
Maintainers
Readme
@rzmps/ammo
Ammo.js collision support for @rzmps/rzmps.
Unlike Rapier and Jolt, Ammo.js does not have a single standard npm distribution. This package therefore does not depend on a specific Ammo.js package.
Instead, AmmoCollisionBackend accepts any compatible initialized Ammo.js
implementation along with its physics world.
Installation
npm install @rzmps/ammoInstall whichever Ammo.js distribution your application uses separately.
Usage
import { AmmoCollisionBackend } from "@rzmps/ammo";
import { Collision } from "@rzmps/rzmps";
const backend = new AmmoCollisionBackend({
Ammo,
world,
});
const collision = new Collision({
backend,
});Ammo should be an initialized Ammo.js API implementation, and world should
be its btDiscreteDynamicsWorld.
This allows @rzmps/ammo to work with custom Ammo builds, GitHub builds, WASM
distributions, or other compatible Ammo.js packages.
