of + bullet physics ghost objects

Hi,

This question is very Bullet Physics specific, but I’m stuck trying to implement a ghost object in my app.

This is how I create the ghost objects:

  
    btGhostPairCallback* ghostCall = new btGhostPairCallback();  
    world->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(ghostCall);  
  
    btGhostObject* ghostObj = new btGhostObject();  
    btCollisionShape* shape = new btBoxShape(btVector3(ofGetWidth()+1000, ofGetHeight()+1000, 50));  
    ghostObj->setCollisionShape(shape);  
    btTransform trans;  
    trans.setIdentity();  
    trans.setOrigin(btVector3(0,0,-500));  
    ghostObj->setWorldTransform(trans);  
    ghostObj->setCollisionFlags( btCollisionObject::CF_NO_CONTACT_RESPONSE);  
    world->addCollisionObject(ghostObj,btBroadphaseProxy::SensorTrigger,btBroadphaseProxy::AllFilter & ~btBroadphaseProxy::SensorTrigger);  
  

and this is how to try to find the collision:

  
	btCollisionObject* obj = world->getCollisionObjectArray()[j];  
	btRigidBody* body = btRigidBody::upcast(obj);  
  
        btAlignedObjectArray < btCollisionObject* > objsInsidePairCachingGhostObject;  
        btAlignedObjectArray < btCollisionObject* >* pObjsInsideGhostObject = NULL;  
        btGhostObject* ghost = btGhostObject::upcast(obj);  
  
        if(ghost){  
            objsInsidePairCachingGhostObject.resize(0);  
            pObjsInsideGhostObject = &ghost->getOverlappingPairs();  
            cout << ghost->getNumOverlappingObjects() << endl;  
  

with this way I always get a response that all my world objects are in collision with the ghost object when there is no really collision happening in the world.

maybe someone can give me a clue about how to solve this?

thanks