Little Offset between RigidBody and SceneGeometry

Topper

05-02-2011 14:33:40

Hi,

i've got al little problem. The spere on the image is the rigid body and it's radius is 0.2m. In the image ther are a yellow box, i think it's the bounding box of the spere and a slightly smaller red one. i don't know what the red one represents but the offset between these boxes seems to be the problem.

does anyone know a solution for this problem?

betajaen

05-02-2011 16:02:36

The red one I think is the bounding box, the yellow one is the bounding box + skin width. I don't know why the red one is smaller than the sphere though; may be for collision purposes, perhaps the bounding box less half the skin width.

Topper

05-02-2011 16:29:37

Hi,

i have tested a extrem larger model and the differences between these boxes are there too, but the sphere doesn't get into the box.

Btw. both test applications have created the physic bounding volumes the same way, i have changed only the models.
So could it be a calculation problem? or why does the sphere in the first image stands on the bottom of the box and not on its top?


betajaen

05-02-2011 19:16:50

The reason why the box and sphere are slightly penetrated is due to skin width.

Skin Width

The simulation deals with inaccuracy when stacking objects by letting them slightly inter penetrate each other. The amount of permitted inter penetration can be regulated at a scene level using the NX_SKIN_WIDTH parameter. Clearly, a lot of inter penetration is visually undesirable. On the other hand, forbidding inter penetration is even worse, because objects may repel each other to the point where they separate, and then fall back down on each other in a subsequent time frame. This leads to visible jittering. The amount of inter penetration that is best permitted depends on many things such as the size of the objects involved (so that the inter penetrating region is visually negligible) but also on the stability of the simulation, which is usually governed by the gravity setting as well as the time step size. (Lower gravity and smaller time steps typically result in more stable simulations.)

Skin width specifies how much objects can inter penetrate, as opposed to how much they are separated.

There are two options for setting the same property; either by using the following method:

void NxShape::setSkinWidth(NxReal skinWidth); (Shape:setSkinWidth in NxOgre)
void NxShape::getSkinWidth();or by using the skinWidth member of NxShapeDesc.

To reduce the visual effect of interpenetrations due to the skin width, it is possible to inflate the size of physics objects with respect to their graphical representation. The SDK provides support for this when cooking convex meshes. See NxCookingParams::skinWidth. For other types of shapes, the user must manually scale shapes when providing them to the API.



Basically it's a feature.

Topper

05-02-2011 19:59:25

hi,

yeah this solves the problem. thanks for your help.