Top down pivot constraint confusion

Official forum for the Chipmunk2D Physics Library.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Top down pivot constraint confusion

Post by slembcke »

Ah, I see. I used the maximum stopping distance to calculate the max velocity that can be stopped in time. Basically we just moved a couple of the operations around and you precalculated the acceleration which is fine if the pivot's maxForce or the body's mass don't change. Otherwise they are the same thing.

You'll probably still need to subtract a little from the distance to avoid the oscillation problem, and multiply by ~0.9 to avoid the overshoot though. Although if your acceleration isn't that big, it might not be noticeable.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
dorthysmash
Posts: 5
Joined: Thu Mar 10, 2011 11:21 pm
Contact:

Re: Top down pivot constraint confusion

Post by dorthysmash »

Cool. So far my solution is working well (no oscillation or at least it's not visible) so I think I'll just stick with it for the time being. Your equations are a little over my head and I at least understand how my equations work (which is also why I'm using chipmunk and not doing this stuff myself, maths are hard). I don't plan to change the mass or maxForce on the object. If I start running into oscillation issues (or other strange behavior), then I'll add in the 0.9f magic number to scale it back a bit. Thanks!
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Top down pivot constraint confusion

Post by slembcke »

Fair enough. I totally understand the appeal of using your own code so you know how it works. That's why I wrote Chipmunk. ;)

Cheers.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests