issue #4118 physical performance improve

1. fix some contact bugs.
2. improve physical performance
3. add PhysicsBody::setResting() function.
4. add a physics contact test.