custom collision response to control the impulse, possible?

Post Reply
hyyou
Posts: 96
Joined: Wed Mar 16, 2016 10:11 am

custom collision response to control the impulse, possible?

Post by hyyou »

Does Bullet have any callback that let me override calculation of impulse of some pair of colliding btRigidBody manually?

e.g. B C and D are btRigidBody.

If I set my special UserData to B & C, when B & C collide each other, it will call my custom collision response similar to this :-

Code: Select all

collisionResponseOverride(manifold , btRigidBody* B, btRigidBody* C){
    if(B->userData()!=nullptr && C->userData()!=nullptr){  //override Bullet  
          manifold.firstObject.applyImpulse (  .......  )
          manifold.secondObject.applyImpulse (  .......  )
          return true;
    }
    return false; //let Bullet do it as usual    B-D, C-D
}
These are related post (provided just in case, but not help)
http://www.bulletphysics.org/Bullet/php ... f=9&t=7400
http://www.bulletphysics.org/Bullet/php ... f=9&t=7481
Post Reply