Live data from Hacker News

Verlet-js - Open source dynamic body physics engine

subprotocol.com

31–40 of 57 posts

Re: Verlet-js - Open source dynamic body physics engine

#33
post #27

Earlier quoted context omitted.

I thought you were joking (about dragging the spider out), but it actually works! Extremely well-done.

You drag it slightly off the web and she will hold on for dear life. Verly funny!

Amazingly "life-like" behaviour on the spider considering such simple "AI"

Re: Verlet-js - Open source dynamic body physics engine

#34
post #14
post #6

Earlier quoted context omitted.

Also Box2D JS and Box2Dweb http://box2d-js.sourceforge.net/ https://code.google.com/p/box2dweb/ Bullet JS https://github.com/adambom/bullet.js/ Cannon.js https://github.com/schteppe/cannon.js Ammo.js https://github.com/kripken/ammo.js/ Physijs http://chandlerprall.github.io/Physijs/ JigLibJS https://github.com/supereggbert/JigLibJS

Interesting list but I wonder how do these libraries fare when used by JS developers? What are their performances and experience with them?

Here are some examples of ammo.js running in PlayCanvas[1]

Vehicle: http://apps.playcanvas.com/will/ammo/vehicle

FPS Character Controller: http://apps.playcanvas.com/playcanvas/physics/charactercontr...

Crates!: http://apps.playcanvas.com/will/ammo/crates

[1] Disclaimer: I'm a co-founder :-)

Re: Verlet-js - Open source dynamic body physics engine

#36
post #14

Earlier quoted context omitted.

Interesting list but I wonder how do these libraries fare when used by JS developers? What are their performances and experience with them?

Also, a verlet-based physics engine is a very different beast compared to a rigid-body one (a few in the list above are also based on verlet, but not most).

Err, I thought verlet was just an integration technique? How does it translate into a "very different beast"?

Re: Verlet-js - Open source dynamic body physics engine

#37
post #3

Earlier quoted context omitted.

Looks great, thanks for sharing. One thing I would suggest is to not worry about rendering the physics on the canvas, threejs is good at what it does and lacks a good physics engine. It's just my opinion, but I think the project would benefit from either making it work with threejs or by not solving the render problem, and just focus on doing great physics, so that people can use the results in their threejs scenes.…

This is a really great point. Abstracting it away shouldn't be bad, and it is possible to extend by vec2 implementation to 3d. After I finish my next batch of examples I will venture down this path. Thank you for the feedback!

There is a physics engine for threejs- it's somewhere on their demo page. I'm actually working on a physics engine as well- I'm willing to help you extend it in whatever direction.

A question, Why did you chose Verlet integration? I know it's great for particles but I always had issues trying to do angular mechanics.

Re: Verlet-js - Open source dynamic body physics engine

#38

Earlier quoted context omitted.

Also, a verlet-based physics engine is a very different beast compared to a rigid-body one (a few in the list above are also based on verlet, but not most).

Err, I thought verlet was just an integration technique? How does it translate into a "very different beast"?

Verlet integration uses an object's change in position at time t to determine the velocity for t+1- it is typically used for particles not full rigid bodies.

Re: Verlet-js - Open source dynamic body physics engine

#39
post #38

Earlier quoted context omitted.

Err, I thought verlet was just an integration technique? How does it translate into a "very different beast"?

Verlet integration uses an object's change in position at time t to determine the velocity for t+1- it is typically used for particles not full rigid bodies.

Verlet is incredibly stable and allows you to update the position of a mass directly (velocity, force, momentum are all implicit), making it very easy to work with if not very accurate. You can't emulate rigid bodies very well (shape matching kinda works), collision response and stacking is a pain in the ass.

Re: Verlet-js - Open source dynamic body physics engine

#40
post #38

Earlier quoted context omitted.

Verlet integration uses an object's change in position at time t to determine the velocity for t+1- it is typically used for particles not full rigid bodies.

Verlet is incredibly stable and allows you to update the position of a mass directly (velocity, force, momentum are all implicit), making it very easy to work with if not very accurate. You can't emulate rigid bodies very well (shape matching kinda works), collision response and stacking is a pain in the ass.

Alright, then why not do the very minor step up to Velocity-Verlet?
Post reply on HN