I'm working on a web-based 3D FPS game using WebGL, HTML5 and JavaScript. It is supposed to target PCs and net-books with WebGL-enabled browsers installed.
I'm wondering if there's an existing open source 3D physics engine written in JavaScript?
I'm working on a web-based 3D FPS game using WebGL, HTML5 and JavaScript. It is supposed to target PCs and net-books with WebGL-enabled browsers installed. I'm wondering if there's an existing open source 3D physics engine written in JavaScript? |
||||
closed as not constructive by Sean Middleditch, bummzack, Byte56♦, Sam Hocevar, Josh Petrie♦ Mar 6 '13 at 16:12As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question. |
||||
|
There are a couple both jiglib and bullet have been ported but it's still very early days. See http://www.jiglibjs.org and http://pl4n3.blogspot.com/2010/11/webglbulletjs-demo.html |
|||||
|
Have a look at ammo.js: https://github.com/kripken/ammo.js/. It is a port of the Bullet Physics engine. There is also a demo repository for it here: http://schteppe.github.com/ammo.js-demos/. It might help you get started. |
|||
|
I don't know about any 3D physics-engine implemented in JavaScript. But maybe you could have a look at the Quake2 > HTML5 port and look how they did it: http://code.google.com/p/quake2-gwt-port/ From what I understood, they used the Google Web Toolkit (GWT) to compile Java-Sources to JavaScript. I think this approach may have some benefits for your project as well, since it's much more likely that you'll find a good 3D physics-engine for Java than for JavaScript. |
|||
|
I would take a look at I've used it in a couple of projects and works quite well. It also has nice documentation. |
|||||
|
While personally I use ammo.js (see schteppe's answer) through Physijs wrapper, I'd also like to mention cannon.js, which is specifically created for JavaScript, unlike ammo.js, which is automatically compiled from C++ to JS. The downside is much less features in cannon.js. JigLibJS which was mentioned by Paul Brunt appears to be unmaintained. |
|||
|
cannon.js. It's much faster than ammo.js because it was written in native JS instead of being ported from C++. Unfortunately, its documentation is pretty much nonexistent. |
|||
|