开发者

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 i开发者_高级运维s: drap-droping and rotating.)


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜