Members - Reputation: 917
Posted 16 July 2012 - 03:41 PM
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?
Prime Members - Reputation: 2314
Posted 16 July 2012 - 07:09 PM
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?
Edited by NumberXaero, 16 July 2012 - 07:11 PM.