Optimisied fork of box2d-js with support for Springs and SVG demos
Pull request Compare This branch is 1 commit behind hrj:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
demos
images
js/box2d
lib
style
LICENSE.txt
README.md
blank.svg
index.html
old_index.html

README.md

Demo

View the demo here.

About this fork

This fork has the following changes over the original:

New features

  • Spring Joint (simple version, suitable for simulation of soft bodies)

Code Optimisations

  • Removed dependency on prototype.js
  • Simple optimisations to core library, using for loops.
  • Tried to avoid frequent instantiations of b2Vec2

About this library

The original box2d-js library is hosted on sourceforge.

It seems to be currently unmaintained and uses the HTML5 Canvas element for display.

Demo features

  • Use of SVGs instead of Canvas

    • Using jquery and jquery.svg
    • only create a shape for the first time, then use transformations
    • if static or sleeping then don't redraw
  • throttling of step size and inter-frame delays, to achieve a target FPS.

  • a new demo scene called drop to show off spring-joints.