Jump to content
  • Advertisement
Sign in to follow this  
-Tau-

Bullet physics: needBroadphaseCollision - need better explanation

Recommended Posts

Hello, I'm trying to use needBroadphaseCollision to filter collision between moveable objects and player. It works pretty well but there is one problem.

The idea is simple: If an object is still or does not move faster that a threshold, ignore collision with players physical body. In this case I use my own code to update player. If the speed of this object breaks that threshold, convert player to rag-doll and let Bullet do the update.

I'm using my own custom character controller as i couldn't use Bullets. My player is a ragdoll with btRigidBody bodyparts where linear and angular factors are set to 0 and these limbs are updated based on model animation as long as the player has control over their character. As soon as collision with a fast moving object happens, player loses control over their character, linear an angular factors are set to 1 and i let Bullet handle the ragdoll physics.

It works well for most objects but i have an object that uses btCompoundShape for its body. When this object is still, (it didn't move for a while) it works.
However when this object starts to move and doesn't break the speed threshold, it gets affected by players physical body (player starts to push this object around).
I added some debug variables and it seems that even when needBroadphaseCollision returns false, there are still contact points generated between player and this object.

What am i missing?

Share this post


Link to post
Share on other sites
Advertisement

Never mind, solved it by switching from broadphase filter to narrowphase filter. Basically the exact same code but I'm using

mDispatcher::setNearCallback

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
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!