Copule Collision Detection Questions (Moved frm other forum)

uprise78
Posts: 1
Joined: Tue Apr 20, 2010 3:09 am

Copule Collision Detection Questions (Moved frm other forum)

Post by uprise78 »

First Question:
I have a pretty simple situation where I have a bunch of static objects (platforms) and one dynamic object (player). Is it possible to at any time find out of the player is in contact with any static objects without having to iterate over all of the platforms? I am currently sending out a few raycasts to detect the platforms but this feels a bit hackish. I'd basically like to do something like the following:

- run physics step
- check if player is in contact with any platforms
- do something based on if the player is touching a platform


Second Question:
Adding to the above setup of a player and platforms assume there are a whole bunch of objects with rigid bodies (collectables) in the world. Is it possible to have a callback function that will be called every time player collides with any of the collectables? I can see from the docs that you can manually add collision callbacks for each and every collectable object and the player but I was wondering if there is a more global collision callback to avoid having to manually add possible hundreds of collisions.