Collision Efficiency Question [SOLVED]

Here’s another question, that’s a little more straightforward.

I will be creating a scene which includes animated actors moving around. I don’t want them to run into one another. I have thought of a couple methods to make this work.

Firstly, I could use collision detection to determine if actors are about to collide. If I do so, would the collision calculations be faster if I used a collision sphere around the actors, or would I be better off putting 4 rectangular polygons into the actor model to act as it’s borders? Will the sphere or the 4 polygons be more efficient?

Secondly, rather than using collision detection, I could use distance calculations between the actors to make sure they don’t get too close to one another.

In either method, I plan on using a sort of region by region breakdown to limit which actors are checked against each other. I’ll divide the scene into regions and only check against other actors in the same region.

I may use collision detection for mouse picking on the actors. Should that influence my decision?

The sphere will be much more efficient. Plus, Panda’s built-in collision system doesn’t even support polygon-polygon collision tests (though it does support sphere-sphere collision tests).

This is basically the same thing as a sphere-sphere collision test, except you will (presumably) be doing the test in Python instead of C++, so it will be slower.

Sounds like a great strategy.

Not really; that will probably be an unrelated use of the collision system, so it won’t really impact much the mechanism that you use for avatar-avatar collisions.

David

Great answers David, thanks for clearing that up for me.