sphere-sphere collision when inside each other
-
- Posts: 8
- Joined: Sat Jan 30, 2010 3:03 pm
sphere-sphere collision when inside each other
I use Bullet collision detection (not physics simulation) in my game. aparently, sphere-sphere collisions are not reported if one sphere is completely in the other. Can I somehow switch on that spheres completely in another sphere are regarded as a collision too?
-
- Posts: 8
- Joined: Sat Jan 30, 2010 3:03 pm
Re: sphere-sphere collision when inside each other
bump
how can I make sure the collision detection threads spheres as intersecting if one is inside the other?
how can I make sure the collision detection threads spheres as intersecting if one is inside the other?
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: sphere-sphere collision when inside each other
Hi,genesys wrote:bump
how can I make sure the collision detection threads spheres as intersecting if one is inside the other?
volumes should detect intersection, even when they are inside eachothers.
If you can reproduce the problem in one of the bullet demos you may want to create an issue:
http://code.google.com/p/bullet/issues/list
-
- Posts: 16
- Joined: Sat Dec 18, 2010 1:30 am
Re: sphere-sphere collision when inside each other
If you're not using the bullet physics simulation then how are you doing the detection? Are you using btCollisionWorld::contactTest to run your test?
-
- Posts: 8
- Joined: Sat Jan 30, 2010 3:03 pm
Re: sphere-sphere collision when inside each other
I don't use physics simulation - only collision detection like this:
Code: Select all
//...update world transforms of collision objects...//
collisionWorld->performDiscreteCollisionDetection();
int numManifolds = collisionWorld->getDispatcher()->getNumManifolds();
for(int i=0; i<numManifolds; i++){
btPersistentManifold* contactManifold = collisionWorld->getDispatcher()->getManifoldByIndexInternal(i);
if (contactManifold->getNumContacts()>0){
btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0());
btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1());
//inform the collieded objects that they just collided:
IEDCollidable* colA = collisionObjectToCollidable[obA];
IEDCollidable* colB = collisionObjectToCollidable[obB];
colA->collisionCallback(colB, obB);
colB->collisionCallback(colA, obA);
}
}