getting same behavior of nx_skin_width on physx 3.3.3


i have a game scene setup in unity 4.7(physx 2.8.4) with physics>minpenetrationforpenalty (i guess it’s nx_skin_width) of 0.01.

and i am trying to get the same behaviour on unity 5.5 (physx 3.3.3)

i tried to make the colliders 0.01 smaller and setting the contactoffset to 0.01 to get the same effect but i have some complex colliders that i can’t make them smaller in such a way. unity doesn’t expose restoffset or tolerancescale of physx 3.3.3 only contactoffset.

any ideas?
or simply my collision results are different because of other changes in the physx sdk ?

The contact gen code has changed between 2.8 and 3.3 significantly, as has the constraint solver and various other stages of the pipeline so it’s pretty unlikely you can get identical results.

The way to do something similar to 2.8.4 would be to use a negative rest offset with a contact offset of 0. To avoid visible clipping, your collision geometries would need to be larger than your render geometries so that the effect looks like the visual mesh is just touching. However, as you noted, Unity doesn’t expose this variable for you to access.

In PhysX 3, the recommended way to work is to use 0 rest offset and use positive contact offsets. The contact offset is an aura around the geometries in which contacts with separation distances are generated. These contacts are used to ensure that your geometries don’t become penetrated next frame to avoid cases where objects bounce in and out of contact. It works a lot like skin width in 2.8 but the idea is that your geometries just need to match your render mesh - you shouldn’t need to inflate or deflate them.

Hope this helps