I've noticed that if I specify masses that are too small for the children of a CompoundBody, then the Entity representing the CompoundBody ends up with a bunch of NaNs in various member variables. From what I can tell, the only thing that really affects (prevents) it, is increasing the mass of the children.
If I don't specify a mass, and the child defaults to infinity, that also causes a problem. In my particular case, I'm only adding one child to the CompoundBody and the mass is a reasonable (or so I thought) 1.0f.
Just looking for some general guidelines regarding this. Thanks.
Tips for mass of children that compose a CompoundBody?
Re: Tips for mass of children that compose a CompoundBody?
Not specifying a mass creates a kinematic object which cannot respond to forces (infinite mass).
Adding a single body of mass = 1 to a compound body should not cause any issues; as long as you stay within a fairly normal range of masses for your objects (large mass differences between colliding objects can make it hard on the velocity solver) it should work fine.
Unfortunately, there is a problem with the way the CompoundBody inertia tensor is computed. I just fixed this for v0.10.0 but in the mean time using a stand-in inertia tensor for when you encounter problems like this will work well enough. After you set up your compound body, create a Box with dimensions equal to the bounding box of your compound body and appropriate mass. Set the localSpaceInertiaTensor of the CompoundBody to that of the box's localSpaceInertiaTensor. This obviously won't be exactly right, but will be good enough for many situations.
Adding a single body of mass = 1 to a compound body should not cause any issues; as long as you stay within a fairly normal range of masses for your objects (large mass differences between colliding objects can make it hard on the velocity solver) it should work fine.
Unfortunately, there is a problem with the way the CompoundBody inertia tensor is computed. I just fixed this for v0.10.0 but in the mean time using a stand-in inertia tensor for when you encounter problems like this will work well enough. After you set up your compound body, create a Box with dimensions equal to the bounding box of your compound body and appropriate mass. Set the localSpaceInertiaTensor of the CompoundBody to that of the box's localSpaceInertiaTensor. This obviously won't be exactly right, but will be good enough for many situations.