Collisionhandlerqueue question

Ok im still working on my first collision handling thing where the ship bounces off the planet if it touches it. This is just for me to test the colision handling but im done making the collision solids (the ship and earth have a sphere as the colision solid ) so now i need to make a collision handler. so the one in the manual that is said to be the easies is the collision handler que. But i have a question in regards to it. I was wondering if i had to give each object their own collisionhandlerque or is it something that takes care of the global collisions? And is there any samples that cover this because i coulndt find any in the panda3d samples.

Might want to check this out…

I seem to recall getting enough info from the manual to work with last I tried. I don’t have the notes I put together for teaching Panda collisions handy atm, but iirc you can have multiple things dump into the same collision queue, which lets you handle any collisions that have built up in your own time. The code snippet in the manual shows how to get stuff out of the queue, and from there, you can check the API to see what all is in a collision entry to begin with.

I personally prefer the event setup which lets me direct different events to different handlers so I don’t have to manually filter/investigate, but to really leverage the event system you need to be comfortable with custom naming/regexing of your events.

Same here. Also, since Panda is doing the event queue management in pure C++ code, it’s got to be faster than using a CollisionHandleQueue and then cycling over the entries returned to find the one you want in Python.

I would stick to a CollisionHandlerQueue if you’re interested in a single-fire traversal where you know you will have a fairly consistent work load. (Zero or one events per run, or you know that you are going to want to do stuff with every entry returned in the queue.)

LKN is right, the handlers are assigned on a per-collider level. So you can just dump all into one big queue or you can have different sorts of handlers for different kinds of collisions. You probably won’t see a lot of examples of this because how you design your collision layout is really dependent upon the type of game you are making.