I need to query if a collision happens at all in my collision world.
I have one million sphere objects and a complex triangle mesh with given transformation - no animation, I just want to query the state.
My collision world looks like this
Code: Select all
m_collisionConfiguration = new btDefaultCollisionConfiguration();
m_collisionDispatcher = new btCollisionDispatcher( m_collisionConfiguration );
m_collisionBPI = new btDbvtBroadphase();
m_collisionWorld = new btCollisionWorld( m_collisionDispatcher, m_collisionBPI , m_collisionConfiguration );
Code: Select all
m_collisionWorld->performDiscreteCollisionDetection();
That is probably because it calculates the pair cache and the contact manifolds for all the collisions. If I retransfrom the object that collides, such that there is no collision anymore, it strangely takes even longer to compute (probably because the pair cache does not get cleared).
Is there a way to query for collisions stopping at the first collision? Because I dont need all the fancy pairs and manifolds - I just need to check if a collision happens at all. Please help!
Thank you!
Patrick