Package for running RbPhys2D in dedicated WebWorker.
Information regarding to contact between two bodies is not taking into account when listening collision events.
User defined joints
are also not working.
Using npm
package manager:
npm install rb-phys2d-threaded
import { createWorld } from 'rb-phys2d-threaded';
// Use the synonymous factory
const world = createWorld({ ... });
<!-- include bundle -->
<script src="./node_modules/rb-phys2d-threaded/dist/bundle/rb-phys2d-worker-source.js"></script>
<script src="./node_modules/rb-phys2d-threaded/dist/bundle/rb-phys2d-threaded.js"></script>
<script>
// use global accessible object rbPhys2dThreaded
const world = rbPhys2dThreaded.createWorld();
// ...
</script>
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.