Public Group

opengl and collision detection

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

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 on other sites
Quote:
 Original post by phil67rpgis there a simpler equation for determining a bounding box collisionif((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 on other sites
ok thanks for all the help, I will figure it out

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 12
• 15
• 11
• 12
• Forum Statistics

• Total Topics
634153
• Total Posts
3015844
×