questions on ghosts

theyesfish
Posts: 10
Joined: Sat Apr 11, 2009 7:12 pm

questions on ghosts

Post by theyesfish »

I've got a few questions about ghosts, they're just not documented!

When does a ghost clear it's cache? Is it every frame? Every step? Or do I clear it when I'm checking it's collisions?

What are the methods convexSweepTest and rayTest for?

How do I get the cache from a btGhostObject? btPairCachingGhostObject is covered but I haven't seen any samples of btGhostObject in use.
theyesfish
Posts: 10
Joined: Sat Apr 11, 2009 7:12 pm

Re: questions on ghosts

Post by theyesfish »

Replying to my own topic, lol...

Found the method to get object data from a regular btGhostObject:

for(int t = 0; t < ghost->getNumOverlappingObjects(); t++)
{
btCollisionObject* o = ghost->getOverlappingObject(t);
}

but it only returns the data for the AABB collisions, so it's kind of useless. I guess it could be used for AABB detection zones?

The cache is cleared at the start of each substep (at least I think so).
Still don't know what convexSweepTest and rayTest do.
pico
Posts: 229
Joined: Sun Sep 30, 2007 7:58 am

Re: questions on ghosts

Post by pico »

Hi,

the sweep tests test a collisionShape with the objects within the ghostObject. So you save asking the broadphase for collisions. This is pretty nice for character controllers.