Collision Detection. Where does it fit?

Started by
1 comment, last by Bob Janova 17 years, 10 months ago
I have a class CTank and a class CTerrain. Where does the collision detection system fit into. Should I create a new class CCollisionSystem, or a manager class that addresses both the tank and the terrain and contains collision code. Am a bit lost over here.
[ my blog ]
Advertisement
you can do the world "physicalization" as a part of the game logic - after the world update you call a "handlePhysics" function, which takes the interessting objects and test them for collisions. FAQ, google, search - there you will find some more.
One sensible model is to have a collision manager (probably part of your physics system) which checks objects for collisions, either with each other or with the floor, and then tells the objects what they've collided with so they can do appropriate things.

This topic is closed to new replies.

Advertisement