I have a great AABB system up and and working in my opengl engine. Im loading animated milkshape s as both levels and characters. (sweeeeeeet…)
However, when i go to scan the vertices (400 or so) for the max’s and min’s i get
max: 6, 7, 25
min:-6,-11,-6
(rounded up)
when milshape tells me:
max: 15, 35, 13
min:-15,-40, -9
I don’t see a problem in the code that would cause your problem, but in general your method is a bit wrong, or rather, has the potential of producing incorrect results. You should initialize the min and max with the first vertex rather than (0,0,0), as there is always the possibility of (0,0,0) being outside the AABB.
The problem that fixes is not the problem you are having, as in this case (0,0,0) is in the AABB. I was merely pointing out that if the you had a AABB which did not contain (0,0,0), then your method would fail. Again, the problem you are describing is not the same problem I was pointing out.
Try casting Mod->m_pVertices[0].m_location[0]; as whatever type Min[0] is when you’re setting m_location[i] to Min/Max[i]. If they are different data types you may have bad bits or you may be overwriteing the next location in memory.