I checked it a few times, but if somebody finds a mistake feel free to correct.
I would like to prepare a demo on long range interaction and how to change the integrator without changing Chipmunk source code...Do you find this useful or not? Nonetheless i cannot give a date for the release of such tutorial.
Yeah, go for it. I'm sure someone would find it useful. I've thought about adding some electrical charge puzzles to one of my upcoming games actually. Could be a nifty idea.
Speaking of which, I really need to get that Chipmunk wiki put up...
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
slembcke wrote:Yeah, go for it. I'm sure someone would find it useful. I've thought about adding some electrical charge puzzles to one of my upcoming games actually. Could be a nifty idea.
Hey, I am also working in a puzzle game (hinged dissection of polygons or in other words folding puzzles). For the moment without physics...maybe we can share some ideas. PM me if you are interesting in sharing some brainstorming...and a flash sub-demo, jejej
I've tried to make use of the action-reaction principle to reduce the computational load. I've uploaded the patch here.
The CPU load is reduced, however, there seems to be a problem, most likely with the torques. I'm not very familiar with the equations or the inner workings of Chipmunk, so probably some assumptions I made are wrong.
One such assumption (which relates to how Chipmunk works), is that the force functions are invoked for each body in order (as found in the cpSpace::bodies)
can someone please check this patch?
EDIT: patch removed. look below
Last edited by ioannis on Wed Nov 18, 2009 11:12 am, edited 1 time in total.
ok, I think I found the error. The sign of the forces was wrong. I'm including here the revised patch. Please do check it as well, see if it does behave as expected.