Original Post
I would like opinions about one simple problem
Right now, i have my own kind of map files, in which i can define both Quad (Squares, rectangles) and Tri (triangles) polygons.
So you all know quads are defined by four points, triangles are defined by one. Now the question is, right now, i only have a CTriangle class, which basically holds a triangle, and it has some member functions like Draw(), GetNormal(),etc... And the quad polygons are split in two tri polygons when the map is loaded.
The map is stored as a dynamic array of those CTriangle objects...
The big deal is.... Should i convert CTriangle into a CPolygon class.... Which can hold any convex polygon.... So that i could store a quad in one CPolygon instead of 2 CTriangle objects.
Of course, using one CPolygon will require me to draw them using GL_POLYGON, which.. isnt as fast as GL_TRIANGLES, i will also need a for loop in the drawing, but on the other hand, i am almost only using quad polygons, so this would greatly reduce the amount of polygons stored in memory..... Lower the memory use for the polygons... It would make less polygons, therefore less collision detection testing .... And only one CPolygon will be drawn instead of two CTriangle
What are your opinions? Is it worth it? Will GL_POLYGON slow down the thing so much that its not worth saving 25% speed on collision detection test?
Looking for a serious game project?
www.xgameproject.com
Looking for a serious game project?
www.xgameproject.com