在PhysX3.2中,刚体模拟相对于2.8.x时代,多了两个概念:contactOffset和restOffset。这两个变量加入的初衷是为了让SDK能够更好的控制相互靠的很近的物体,尽快将他们稳定下来。我们来看看文档对这两个变量的描述:
/**
\brief Sets the contact offset.
Shapes whose distance is less than the sum of their contactOffset values will generate contacts. The contact offset must be positive and
greater than the rest offset. Having a contactOffset greater than than the restOffset allows the collision detection system to
predictively enforce the contact constraint even when the objects are slightly separated. This prevents jitter that would occur
if the constraint were enforced only when shapes were within the rest distance.
<b>Default:</b> 0.02f * PxTolerancesScale::length
<b>Sleeping:</b> Does <b>NOT</b> wake the associated actor up automatically.
\param[in] contactOffset <b>Range:</b> (maximum(0,restOffset),inf)
@see getContactOffset PxTolerancesSc