codeagent / rb-phys2d-threaded

Web worker for RbPhys2D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI npm version

Web Worker For RbPhys2D

Package for running RbPhys2D in dedicated WebWorker.

Limitations

Information regarding to contact between two bodies is not taking into account when listening collision events.

User defined joints are also not working.

Installation

Using npm package manager:

npm install rb-phys2d-threaded

Usage

ESM

import { createWorld } from 'rb-phys2d-threaded';

// Use the synonymous factory
const world = createWorld({ ... });

Browser

<!-- 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>

Contributing

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.

License

MIT

About

Web worker for RbPhys2D

License:MIT License


Languages

Language:TypeScript 98.5%Language:JavaScript 1.5%Language:Shell 0.0%