Skip to content

ITJesse/ammo.js-typings

 
 

Repository files navigation

Ammo.js Typings

TypeScript type definitions auto-generated by parsing official WebIDL bindings for Ammo.js.

What is Ammo.js?

Ammo.js is direct port of the Bullet physics engine to JavaScript using Emscripten.

Why should I use this package while there are other packages?

There wasn't a complete type definitions package for Ammo.js before this project has started. This package is developed by parsing official WebIDL bindings of Ammo.js with a Node.js script automatically. The latest WebIDL bindings of Ammo.js can be found at https://github.com/kripken/ammo.js/blob/master/ammo.idl. A copy of "ammo.idl" file is kept in this repository and updated at each release.

Why is "ammo.idl" file different from Ammo.js repository?

While Emscripten uses a non-conforming WebIDL parser, this package uses W3C's WebIDL parser. So I had to modify "ammo.idl" to pass WebIDL validation. Note that modified "ammo.idl" is not completely correct from the WebIDL specification perspective (e.g. FrozenArray<T> is used as a mutable array for an attribute). Since the build script is only specialized for this package, it doesn't matter for our goal. But, corrections and workarounds are always welcome.

Usage

Currently, there is no NPM package yet. But, you can use it anyway by using the following command:

$ npm install github:osman-turan/ammo.js-typings

Building

If you want to modify WebIDL bindings and generate corresponding type definitions, clone this repository and run the following command to install required NPM packages:

$ npm install

Then, apply your changes to "ammo.idl" file and run the following command to generate updated type definitions:

$ npm run build

Contributing

Please open an issue before submitting any pull-requests.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

TypeScript type definitions auto-generated by parsing official WebIDL bindings for Ammo.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%