Page 1 of 1

Using Bullet Collision Detection in an existing simulator

Posted: Fri Jul 13, 2018 8:15 pm
by rvimadalal
Hi everyone,
I am a researcher working in the field of Granular simulations.

We have an existing code with custom collision detection and physics. I am trying to replace the collision detection algorithms with the ones used in Bullet. The strategy I have employed is to add bullet Rigid body pointers as data members of the Particles class (our equivalent of the btRigidBody) in our simulation. I add these btRigidBodies to discrete dynamics world and then find colliding pairs. So when I get contacting bodies from the persistent manifold I know which bullet objects are colliding. But I also want to know which Particles are colliding because our physics engine works with particles and not btRigidBody. I am thinking of using a map with btRigidBody as the key but since we will be operating on a scale of hundreds of millions of particles, it will be very slow. Any help would be appreciated :)

Re: Using Bullet Collision Detection in an existing simulator

Posted: Tue Jan 15, 2019 3:33 am
by teolazza
btRigidBody inherits from btCollisionShape a user pointer that you can make to point to your data. Just call
setUserPointer on your btRigidBody instance