Impulses on Rigid Bodies
I''ve implemented a fairly bog-standard rigid body simulator using impulses for collision response.
Many scenarios are working great, including friction and stacking etc.
However one case is coming up that just looks horrible.
If a spinning box lands on one corner then it takes a long time to settle, if at all. If I turn off friction it has a tendancy to bounce on this one point, or bounce from point to point. Once it lands in a flat side, it tends to settle very quickly though.
If friction is turned on, things get worse. It''s as though the friction and the collision response impulses are acting against each other and the box can end up spinning or bouncing on this one corner for ever.
The usual tweaking of constants isn''t getting me very far so I''m hoping for some pointers or ideas of why this is happening and how it can be fixed.
Thanks
igrok.
Unless your friction code understands point contacts with no tangential velocity, you''ll always spin forever. Like say a sphere ending with one vertex at the south pole, when dropped with initial angular velocity will stay spinning forever. The problem can be solved "implicitly" by adding more vertices to the tip, so that there is some tangential velocity.
Hope that helps.
Hope that helps.
Are the impulses affecting the center of mass of the object or are you simulating for each corner of the box (or sphere or mesh...)?
Thanks for the responses.
bpj1138:
I''m not entirely sure why you are saying NO tangential velocity. The friction system calculates the velocity at the contact point using both the linear and angular velocity. It calculates the tangent across the surface away from this direction and uses that to apply an impulse to represent friction. Are you suggesting I should only be taking in to account the linear velocity during this process?
void*:
The impulses are applied at the points of contact. So yes, that means the corner of the boxes in this case.
bpj1138:
I''m not entirely sure why you are saying NO tangential velocity. The friction system calculates the velocity at the contact point using both the linear and angular velocity. It calculates the tangent across the surface away from this direction and uses that to apply an impulse to represent friction. Are you suggesting I should only be taking in to account the linear velocity during this process?
void*:
The impulses are applied at the points of contact. So yes, that means the corner of the boxes in this case.
Igrok,
Forget it, your problem is different than what I was talking about. What I was talking about was the case where you drop an already spinning object on the floor and it lands on one vertex and balances perfectly so that it stays spinning on that one vertex. Kinda like a perfect drop of the spinning top. The top at this point has zero linear velocity and some angular velocity, except it''s spinning exactly around the axis connecting the vertex in contact with the floor and the center of mass, so the vertex has no velocity (it is one of the eigenvectors of that rotation). Anyhow, so since the vertex has no tangential velocity, and if your friction code depends on tangent velocity, it will never slow down that system. The top will stay spinning forever.
Something to watch out for, fortunately, it doesn''t happen that often.
--Bart
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement