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.
Top down pivot constraint confusion
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Top down pivot constraint confusion
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
-
- Posts: 5
- Joined: Thu Mar 10, 2011 11:21 pm
- Contact:
Re: Top down pivot constraint confusion
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!
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Top down pivot constraint confusion
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.

Cheers.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 16 guests