Just for the record guys.
I don't wand to sound like a bad guy but...
Collision detection it's really old and this kind of thing you are trying to do it's point in an AABB.
What is AABB?
axis aligned bounding box
What is this?
It's a box that have it's edges alinged to the axis of the coordinates space.
So this box never rotate and blah blah blah...
I just wanted to say this cause if you really wand to learn stuf like this you must know what you are searching for. And for collision detection, AABB it's the best place to start with.
I don't wand to sound like a bad guy but...
Collision detection it's really old and this kind of thing you are trying to do it's point in an AABB.
What is AABB?
axis aligned bounding box
What is this?
It's a box that have it's edges alinged to the axis of the coordinates space.
So this box never rotate and blah blah blah...
I just wanted to say this cause if you really wand to learn stuf like this you must know what you are searching for. And for collision detection, AABB it's the best place to start with.