hagphysics2d progress
fuzinavl

(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

Optimizations?

Peter Hull

If s is the vector from asteroid to ship and v is the velocity of the asteroid then is the tangential part
v-(v.s)/sqrt(s.s)
?

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

Pete

 No, rubbish, I don't think I understood your problem properly

fuzinavl

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.

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

fuzinavl

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.

Quote:

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