How to disable certain bullet physics

wbaldwin
Posts: 14
Joined: Mon Feb 23, 2009 9:01 am

How to disable certain bullet physics

Post by wbaldwin »

Does anyone know of a way to turn off bullet physics in certain situations? For instance when a character fires their weapon, I want the bullet to continue on indefinitely, without being altered by bullet physics, until it hits something (or a certain amount of time has passed). Is there a parameter that can be changed to allow the physics to be turned off in such a situation?

Thanks in advance,

Bill
bcsanches
Posts: 10
Joined: Mon Feb 02, 2009 2:15 pm

Re: How to disable certain bullet physics

Post by bcsanches »

If you really need to show the bullet, switch do a kinematic body and simulate the bullet yourself, when you need it to behave like a physics object, change its body to be a normal rigid body.
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: How to disable certain bullet physics

Post by pico »

Hi,

it sounds like you still want to know about a collision but you don't want a response, right?
You can use the flag "CF_NO_CONTACT_RESPONSE" todo that.
wbaldwin
Posts: 14
Joined: Mon Feb 23, 2009 9:01 am

Re: How to disable certain bullet physics

Post by wbaldwin »

Thanks for the quick responses, much appreciated.

Showing the bullet as a kinematic body and later changing it to a normal rigid body seems like it could work well for what I'm trying to do, I'll give it a shot and see what happens.
elLolo
Posts: 14
Joined: Thu Dec 11, 2008 2:18 pm

Re: How to disable certain bullet physics

Post by elLolo »

Hi!

I would like to add a constraint between two rigid bodies where one has collisions disabled.

I tried CF_NO_CONTACT_RESPONSE so rigidBody->hasContactResponse() returns false.
Currently, this object can interpenetrate any object but collision detection does not seem to be totally turned off. In fact, the following code still finds contacts:

Code: Select all

  int nbOfManifolds( collisionWorld.getDispatcher()->getNumManifolds() ) ;
  for( int i( 0 ) ; i < nbOfManifolds ; ++i )
  {
    btPersistentManifold* contactManifold(
      collisionWorld.getDispatcher()->getManifoldByIndexInternal( i ) ) ;

    int numContacts( contactManifold->getNumContacts() ) ;
    for( int j( 0 ) ; j < numContacts ; ++j)
    {
      const btManifoldPoint& pt( contactManifold->getContactPoint( j ) ) ;
     ...
    }
}
What am I doing wrong?