[SOLVED] CollisionHandlerPusher access CollisionEntry list?

How to get the list of CollisionEntry from a CollisionHandlerPusher, ie the same stuff that a CollisionHandlerQueue would leave access to?

tried miserably :blush: :

PT(CollisionHandlerQueue) PusherH_Queue = DCAST(CollisionHandlerQueue,Pusher);
std::cout << "Pusher: " << PusherH_Queue->get_num_entries() << "\n";

for (int i=0; i<PusherH_Queue->get_num_entries(); i++) {
   PT(CollisionEntry) entry = PusherH_Queue->get_entry(i);
   std::cout << entry << "\n";
}

The CollisionHandlerPusher doesn’t save its entries up in a queue, because, well, it isn’t a queue. But it does inherit from CollisionHandlerEvent, which means it throws an event for each collision it detects, and that event includes the CollisionEntry pointer.

So if you want to get all of the CollisionEntries detected by a CollisionHandlerPusher, you have to set an event callback and record them as you receive them.

David

got it, thks!

An additional question purely related to action precedence: when the event callback procedure is called, has the pusher already moved back the colliding node (or its parent) (ie changed its coordinates) or does it do it after the callback procedure is executed?

It will already have been moved.