PhysX Detaching Shapes hard to understand

Started by
1 comment, last by noatom 11 years, 9 months ago
Well I got to a topic in the documentation that is pretty hard to understand,it's called Detaching Shapes.I have a sample app,you control a first person camera,and you can throw snowballs.

In the documentation it says: "some of the shapes detach on contact with a snowball".

So,if I have a collision with a snowballs,what is that "detaching" process that is initiated.What does it do?
Advertisement
I guess you are referring to the snowman example, where you can hit the snowmans nose with a snowball and the nose falls to the ground.
In that example they build the snowman, and set the nose shapes filter data with a custom detachable flag. In the contact report callback, when nose shape is hit by a snowball (also has a custom flag) the nose shape is saved in a list for detaching. At some other point at the end of the frame, the list of detachables is processed, each nose shape (created initially as part of the compound dynamic snowman?) is recreated as dynamic actor by itself.
The nose material, render model and transform are copied to the new dynamic actor. The dynamic nose is then dropped into the scene with a small force applied while the static nose is deleted.
So the original compound nose shape is detached from the snowman, and copied to a dynamic actor and allowed to move freely in the scene.

What physx version are you using?
3.2 and thank you for your answer

This topic is closed to new replies.

Advertisement