Lai Yu-Hsuan
Lai Yu-Hsuan

Reputation: 28081

Is there a javascript physic engine can simulate polygons in gravity?

Like Google Gravity. The images are not only act as points but rectangles. They are rotated when I drag-drop them.

I saw jPhysics plugin but it can't simulate rotate.

I don't know how to drag thing with Box2D-js.

Is there a complete lib? or a tutorial which help me to implement by myself?

(What all I want is: drap-droping and rotating.)

Upvotes: 2

Views: 560

Answers (1)

sunetos
sunetos

Reputation: 3508

There is a newer port of box2d to JS called Box2dWeb at http://code.google.com/p/box2dweb/ which seems cleaner than box2d-js (doesn't require a bazillion includes, for one thing) and is ported from a newer version of box2d. There is great example code in the source of http://www.tornadoentertainment.de/Box2dWeb/demo/demo.html?c1 which demonstrates the dragging behavior you want (rotation should be easy to add).

Upvotes: 1

Related Questions