hey there,
Setup: I have a rigidbody (non-kinematic) hand skeleton consisting of capsule colliders to model the actual bones. I have already implemented a kinematic grab Algorithm which works so far, but somehow as soon as around 5 bone colliders come into place they seem to start “jumping / drifting)” around. That’s why I am currently testing some stuff with the physix engine, because I can’t explain that behavior.
PhysiX Configurations: I’ve set currently the Default Contact Offset of 0.02 so that there can not be any kind of penetration. The cube has a scale of 0.1 which does not cause the problem, happens on other scale settings aswell. Solver Iteration is set quite high with 50 and all rigidbodys have continuous dynamic collision detection. The bones have a separate collision layer which does not collide with objects of same layer. The bone colliders have to stay as rigidbodys with OnCollision*() Events because there will be physics implementation aswell with accurate contact points , so using OnTriggers*() is not an Option here.
Testcase: For the test case, I am moving the hand skeleton (Transformation coming from a Leap Motion sensor) towards a rigidbody cube. As soon as a bone collides with OnCollision*() I literally freeze the bone, decouple it from the Leap Motion sensor and only apply a “global Transformation” (less DOF) with respect to the palm Transformation. The Skeleton Hand has a palm, 5 fingers with 3 discrete bone colliders. The cube itself is not moving at all here, grab is deactivated… When I deactivate “global moving with less DOF” during OnCollisionStay(), all bones completely freeze at the right Moment, but when I let the bones still move as described towards the cube their Position seems to get broken. But there is no actual collision Resolution Happening, this all happens still withing the (for my scale) large contact Offset area, so the bones and the cube are definitely separated.
What I am trying to find out now is, if there is some PhysiX behavior what is beraking me here, or if it is my implementation but I actually doubt that in this case. The following Images from the test case are all taken from the physics Debugger tool of Unity 5. I hope somebody sees what the actual Problem is and how to deal with it.
[Image 1] NO_COLLISION: Shows the Hand Skeleton with its rigidbody colliders and the cube. There is no collision detection or Resolution Happening here, all is fine so far.
[Image 2] FIRST_BONE_COLLIDING: First OnCollisionEnter() happens on the top index bone. The colliding bone gets frozen and the “global Transformation” with less DOF is applied to the bones in OnCollisionStay() state. All works as expected so far.
[Image 3] BONES_BREAK_AND_DRIFT: Moving the Hand further towards the cube, all “frozen” bones start to break and drift apart somewhere. Not by a crazy amout of meters, but still quite a bit. However, as one can see all of them are still in the contact Offset area, there is no actual collision Resolution Happening nor Penetration. Why is this Happening?
I can’t really explain why it behaves like this and how to actually deal with that. I am thankful for any help
Thanks alot!