[ammo] Problems with rigidity of sequential constraints
Posted: Sat Oct 15, 2022 12:31 am
I should preface this post by saying that I am working with ammo.js, which is based on a version of Bullet that is several years old now, so maybe this problem is already fixed.
Animated version: https://youtu.be/mv1f-HllwEI
This scene illustrates a problem I've been having with chaining several constraints together. The places where blue and purple objects meet are connected by hinge constraints. The colors of the meshes indicate which rigid body they belong to, with the exception of the orange sphere, which shares a rigid body with the two small purple cylinders adjacent to it. Everything in the scene has a density of 1 and a mass calculated according to its size and density, with the exception of the orange sphere, which has a density of 0.01. The rigid bodies that contain cubes are kinematic, while all of the others are dynamic. All of the constraints in the scene have exactly the same parameters, other than the bodies they connect and the pivot point of the connection.
The problem I'm experiencing is that the rigidity of the constraints when chained together like this seems to depend on the relative masses (or perhaps the relative rotational inertias) of the two linked objects. The center and top examples both work about as expected: there's a little bit of wobble in the constraints but not so much as to be a problem. On the left, though, the purple body is much less massive than the other two, with the result that the constraint practically falls apart under gravity. On the right is a similar situation, although either because of the additional mass of the orange sphere, the separation between the constraints, or both, the wobble isn't quite as extreme.
I can produce similar results by having the entire system of constraints be dynamic and balancing it on a static object such that the more massive parts hang off to the sides. This example happens to use hinges but I've had the same problem with sliders and Generic6Dof constraints as well.
My questions are as follows:
- Is this problem reproducible in more recent versions of bullet?
- If so, is there any fix or workaround to this?
Animated version: https://youtu.be/mv1f-HllwEI
This scene illustrates a problem I've been having with chaining several constraints together. The places where blue and purple objects meet are connected by hinge constraints. The colors of the meshes indicate which rigid body they belong to, with the exception of the orange sphere, which shares a rigid body with the two small purple cylinders adjacent to it. Everything in the scene has a density of 1 and a mass calculated according to its size and density, with the exception of the orange sphere, which has a density of 0.01. The rigid bodies that contain cubes are kinematic, while all of the others are dynamic. All of the constraints in the scene have exactly the same parameters, other than the bodies they connect and the pivot point of the connection.
The problem I'm experiencing is that the rigidity of the constraints when chained together like this seems to depend on the relative masses (or perhaps the relative rotational inertias) of the two linked objects. The center and top examples both work about as expected: there's a little bit of wobble in the constraints but not so much as to be a problem. On the left, though, the purple body is much less massive than the other two, with the result that the constraint practically falls apart under gravity. On the right is a similar situation, although either because of the additional mass of the orange sphere, the separation between the constraints, or both, the wobble isn't quite as extreme.
I can produce similar results by having the entire system of constraints be dynamic and balancing it on a static object such that the more massive parts hang off to the sides. This example happens to use hinges but I've had the same problem with sliders and Generic6Dof constraints as well.
My questions are as follows:
- Is this problem reproducible in more recent versions of bullet?
- If so, is there any fix or workaround to this?