Maybe I'm totally wrong though! This is just a guess. I really need to get into 3D stuff soon.
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Collision Detection Problem
Anyway.
signing off,
mikey.
Thanks.
1) Check for overlap, if yes goto 2
2) Issue collision event and re-position one or both of the objects so that they no longer overlap. (This is best done by moving them backwards along their movement vectors to the last point where the overlap test fails)
Asuming the objects are no longer moving, they'll not overlap again, and 1) will yield false on the next test..
The problems most people have with this is caused by floating point in-accuracy, so you might want to use a "very small" value X and replace all floating point equality comparisons
if(f1==f2)
with:
if ( abs(f1-f2)/Niels