hagphysics2d progress

download DEMO 12/4/05 :D
(right-click, save target as...)

Current Features:
acceleration, gravity, rotation and translation from a 2d force, spring forces
ship_demo, space_dust_demo

To Do:
hagphysics 2d manual and examples
friction, adding masses, elastic collisions, elastic collisions with turning
"hagutil" generic programming utilities library
"concavehull" (with collision detection) library

Comments about interface?


Peter Hull

If s is the vector from asteroid to ship and v is the velocity of the asteroid then is the tangential part

Regarding the interface, why don't you want to 'impose a data structure'? It would make the functions more straightforward.


[edit] No, rubbish, I don't think I understood your problem properly :P


thanks, I figured out the tangental stuff

Every game has it's own data structures and unique physical behavior.
I shouldn't force coders to use my data structures.
Hagphysics2d is easily wrappable.

Fladimir da Gorf

Looks nice, but what would be really nice (though I don't know if it's out of the scope of this project) would be cutting the spring around a polygon (like a ninja rope "cuts to half" if it hits the ground...


I plan to make an elastic cord object which can wrap around a generic set of movable points. The cord will exert forces on every point. The cord will not be segmented or "hang" in a curve due to gravity. The cord might remain frictionless due to the difficulty in programming "resting contact"...:-/

My project will be an asteroids type game, so the lib might not be completely suited for 2d side-scroller platform games w/ gravity.
I recommend flatland for that, though you must use their data objects.

Btw, this is just a code example to supplement the lib manual, not a real project.


cutting the spring around a polygon (like a ninja rope "cuts to half" if it hits the ground...

Sorry, I don't understand. Could you please explain that another way?

Neil Walker

Have you got to sign up to download the file? Why not just attach it? I'd never trust a site that wants a login to download a file as they'll probably pinch my email for spam.


Thread #548376. Printed from Allegro.cc