Jump to content
  • Advertisement
Sign in to follow this  
shiufai

Collision between Kinematic Objects in PhysX

This topic is 3541 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

Hi all, I am trying to use PhysX to develop a small demo of objects bouncing within a interactive/moving cube. Here is how I have been hacking it through: I am creating each wall of the cube as individual kinematic objects and place dynamic objects (i.e. spheres, cubes) within the space limited by the walls. The user can then move/rotate the cube around to see the objects movement within it. Here is what I am stuck on: I am using box controller for each wall. Whenever a user move the cube as a whole, I go through the list of controllers to move and rotate each wall. Problem is the walls collide with one another and pushing themselves out of position from the original cube space. My question: How do I set it in PhysX so that there won't be collisions between kinematic objects (i.e. the character controllers)? Thanks so much! Bill

Share this post


Link to post
Share on other sites
Advertisement
You should use only one cube for the box.

If you decide not to, you could use character controllers.

Share this post


Link to post
Share on other sites
The reason I do separate walls is because I need the cube to be kinematic (user-controlled, within reacting to any objects within the scene)

I am using character controllers on each of the wall. But as I said, the controllers push themselves away when they collide with one another.

is there a better way of doing this?

Share this post


Link to post
Share on other sites
Could you maybe use a distance joint or some other form of constraint. I haven't played with it enough to give a definitive answer just thowing at the wall and seeing if it sticks :p

Share this post


Link to post
Share on other sites
figured i could turn a dynamic object into kinematic using the raiseBodyFlag() method, then control it using the moveGlobal* methods.

so instead of using the character controls for each wall, I can have a compounded rigid body still controlled by the user.. problem solved.

Thanks.

Share this post


Link to post
Share on other sites
First of all, I would personally get rid of the box controllers, you probably don't need them, you can move kinematic bodies around without any additional magic.
There's another thing... Is there a particular reason for which you don't use a single actor with a shape for each wall? If you change this. All the walls geometries will be rigidly connected. Put the actor in the center of the cube and place the shapes around it. Then just rotate the actor... and all the walls will magically move accordingly ;)

If instead you really need to have a separate actor for each wall, you'll need to disable the collision detection/response between the shapes PhysX collision filtering/disabling is pretty complex but also very powerful. Check the documentation. One solution is to use setActorPairFlags or setShapePairFlags with the NX_IGNORE_PAIR to tell the sdk to disable the contact generation for each pair of "touching" walls. Do this after you finished creating the actors and the shapes.

Hope this helps,
cheers.

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!