Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Collisions between groups of polygons

This topic is 5409 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

I have two models that I am trying to do bounding box collision detection between. One of the models is the player model and the other is the world moel which is composed of groups of other polygons. I have a bounding box collision routine which checks the groups of the level model against the player model but when the player moves it goes through the objects. I assume the problem is that I''m not converting the coordinates into world coordinates, how would I go about doing that. It should be noted that I am using OpenGL for this project. Any help would be greatly appreciated. Also, here is the collision routine that I have for the test: bool World::WorldCollision(Player *player) { for(int n = 0; n < objModel->numgroups; n++) // loop through the level objects { CVector gMin = min[n]; CVector gMax = max[n]; if(player->max->xpos <= gMin.xpos) return false; if(player->min->xpos >= gMax.xpos) return false; if(player->max->ypos <= gMin.ypos) return false; if(player->min->ypos >= gMax.ypos) return false; if(player->max->zpos <= gMin.zpos) return false; if(player->min->zpos >= gMax.zpos) return false; } return true; }

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!