Collision Detection & Response: Together or Seperate?

Started by
11 comments, last by leiavoia 19 years, 10 months ago
Really this is a design issue. You can just as easily go either way, its up to you. Decide what fits best, implanting the response within the detection function may be easier to follow and save some typing. On the other hand, seperating the response provides a more flexible approach, sometimes you may simply want to detect a collision and not respond, or respond in a special way.

Personally I prefur to seperate detection from response as it provides more flexibility and, in my mind, provides a better seperation of code. The detection function ONLY detects and the response function ONLY responds, rather than muddling the two together.

I strongly recommend seperation, but you may have an arguement for the opposite approach, the decision is yours. Just my two cents.

Ravyne, NYN Interactive Entertainment
[My Site][My School][My Group]

throw table_exception("(? ???)? ? ???");

Advertisement
My (rather complicated) system is already very cleanly seperated. I did this for flexability and future expansion. However, no design is perfect. Since i seperated the two functions, there is this sticky issue of needing geometry info in the response code. It also may (or may not) require recalculating a lot of the things the detection function already went through.
ODE and some olli''s demos have seperate system I think.
3D Side-Scroller game demo Project-X2 "playable"Lashkar: A 3D Game & Simulation Project demo @ lashkar.berlios.de

This topic is closed to new replies.

Advertisement