• Advertisement
Sign in to follow this  

opengl and collision detection

This topic is 3764 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there a simpler equation for determining a bounding box collision if((x+5.0f>-20.0f+i)||(y+5.0f>-90.0f)||(x<-20.0f+i+40.0f)||(-90.0f<-90.0f+10.0f))

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by phil67rpg
is there a simpler equation for determining a bounding box collision

if((x+5.0f>-20.0f+i)||(y+5.0f>-90.0f)||(x<-20.0f+i+40.0f)||(-90.0f<-90.0f+10.0f))
Um, didn't we just go over this recently? :-)

I think it would be good for your overall grasp of the subject matter to understand that OpenGL has little (if anything) to do with collision detection. Remember, just because you happen to be using OpenGL for graphics does not mean that your questions about collision detection are in any way related to OpenGL. That's like posting a thread entitled 'transmissions and radio reception' on a car repair forum (if there is such a thing) because you're having problems with your radio :)

As for AABB intersection tests, what you've posted there looks like an ad hoc solution to a very specific problem. It might be right (it's too poorly formatted for me to bother looking through it, to be honest), but it would probably be better to construct a generic AABB intersection function, and then feed in the necessary data as arguments.

This will be easier to do if you understand the basic AABB intersection algorithm and exactly what it's trying to do. The algorithm is pretty well documented, so Google should be of help here. Also, drawing a few diagrams can help greatly in terms of understanding what's really going on.

In short, the answer to your question is probably 'yes', but since we don't really know what you're doing, it's hard to be any more specific than that.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement