Jump to content
  • Advertisement
Sign in to follow this  
noatom

PhysX Detaching Shapes hard to understand

This topic is 2255 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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? Edited by NumberXaero

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!