0

It is sad in its docs:

The btGhostObject can keep track of all objects that are overlapping By default, this overlap is based on the AABB This is useful for creating a character controller, collision sensors/triggers, explosions etc

Does it mean it is only AABB of its underlying mesh and so detects only collisions with AABB and not complex mesh structure?

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
DuckQueen
  • 772
  • 10
  • 62
  • 134

1 Answers1

2

There is no difference for collision dispatcher between a ghost object and a rigid body: they behave the same way both in broad- and narrow-phase. If you iterate over dispatcher's manifold array, you'll see proper collisions with ghost objects. Documentation refers to the btGhostObject internal overlapping objects cache accessible via getOverlappingObject(int index) / getNumOverlappingObjects() methods. This cache is populated in the broadphase (thus obviously using only AABB), and you have to set the proper pair callback for this to work (world->getPairCache()->setInternalGhostPairCallback(new btGhostPairCallback);). You can iterate over this cache in the post-tick and check for the actual collisions.

rkhayrov
  • 10,040
  • 2
  • 35
  • 40
  • That is indeed a wary sad thing. Could you share how to perform actuall body vs body collision detection for ghost object? – DuckQueen Jun 07 '13 at 16:26