Settings

Theme

JavaScript Physics Engine

code.google.com

140 points by bauchidgw 15 years ago · 23 comments

Reader

fuzzythinker 15 years ago

I open sourced my "toy" version of JavaScript physics engine just few days ago too. It's not really for serious work, but may be (hopefully) simple and good enough for beginning programmers to learn one way of starting such a project. https://github.com/fuzzthink/SPE.js

paulirish 15 years ago

All the physics engines in JS are documented on the very valuable JSWiki: https://github.com/bebraw/jswiki/wiki/Physics-libraries

wrs 15 years ago

Very nice, but where is this alleged AS3 to JavaScript converter? That sounds quite useful!

  • mortenjorck 15 years ago

    I've been (very) slowly porting an AS3 site to JS/jQ, mostly as a learning experience, but I'd be quite interested in this as well.

progolferyo 15 years ago

The performance of the demo is awesome. Has anyone tried to do anything more complicated and tested performance. Would be fun to make a js game from this.

  • AshleysBrain 15 years ago

    TBH it's a small demo - I've heard while JS engines these days are fast, they still struggle with complex physics simulations. I can't see any performance details/improvements noted in this release - anyone got figures?

    • MrNibbles 15 years ago

      Untrue, I used a port of Box2d (not this port, our own version) to build an "HTML5" game for sony, see link - http://www.youtube.com/watch?v=AicnuLQxHoQ

      Unfortunately the game was taken down due to the Japan situation. Understandable.

      Under Safari i was able to simulate ~80 live physics objects in a high collision environment at full frame render, bound to the DOM at 60fps on reasonable hardware 6 months ago (safari still has the fastest DOM paint time out there now).

      Even when using Firefox 3.6 i could manage around 20 dynamic objects.

      No CSS3 animation, just math and re-paints.

      Javascript Math is not slow (at all), its generally the DOM/Canvas slowing you down.

      • AshleysBrain 15 years ago

        If you've ever used the C++ Box2D, you'll have been able to create hundreds of objects just fine. 80 still isn't much!

        • MrNibbles 15 years ago

          Of course! This is now nearly possible in Chrome/Safari/FF5, but the limiting factor is still primarily re-paint time rather than the simulation itself.

      • franze 15 years ago

        the game looks awesome, any plans for a re-release?

    • bermanoid 15 years ago

      It's also worth checking out GWTBox2d, which is actually Java code run through GWT, and runs surprisingly well: http://gwtbox2d.appspot.com/

      I'm really impressed with what JS can do these days...

pacomerh 15 years ago

Cool, how is this diferent from http://box2d-js.sourceforge.net/

chrisdew 15 years ago

It's really flickery in Ubuntu 10.10 / Chrome/

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection