custom collision response to control the impulse, possible?
Posted: Fri Aug 19, 2016 2:02 am
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 :-
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
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
}
http://www.bulletphysics.org/Bullet/php ... f=9&t=7400
http://www.bulletphysics.org/Bullet/php ... f=9&t=7481