Collision filtering by object, team

Posted by Bill Zimmerman on Game Development See other posts from Game Development or by Bill Zimmerman
Published on 2011-01-13T00:51:31Z Indexed on 2011/01/13 0:59 UTC
Read the original article Hit count: 551

Filed under:

Hi,

I am looking for a good method to determine which objects will be considered for collision with other objects.

My current idea is that each object has the following properties:

alwaysCollidesWith = [list of objects that will always trigger a collision check] neverCollidesWith = [lost of objects that will never be considered] teamCollidesWith = [list of objects that will be checked, provided they belong to a different team]

For example: -projectiles never have to be checked for collisions with other projectiles -players are always checked for collisions with players, regardless of team -projectiles are only considered for collisions if they collide with another teams players

Does anyone see any weaknesses with this approach? Can anyone recommend a better approach?

© Game Development or respective owner

Related posts about collision-detection