Hi I am working on barrier detection.
I used this swept aabb algorithm http://www.gamedev.net/page/resources/_/technical/game-programming/swept-aabb-collision-detection-and-response-r3084.
It suggests two ways to detect collision. 1. broadphase: this is a shorter-algorithm which can only detect non-collision 100%. 2. In order to make sure that there is a collision, the more detailed swept aabb algorithm has to be executed right after the broadphase one.
Strangely the broadphase algorithm alone detects a barrier collision each and every time and the more precise one actually doesn't at all times.
What I do in my code is basically the following: My object moves towards the barrier with a constand speed vx = direction * speed * delta (that's the amount it moves each frame). So positionx = positionx + (direction * speed * delta) each frame. The broadphase-collision is calculated each frame by using vx and vy.
Are there some rare cases where the broadphase can actually detect a collision like in this one I described? Thanks so much for your help
Thanks so much