This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Matrix4x4 | |
{ | |
// The elements of the 4x4 matrix are stored in | |
// column-major order (see "OpenGL Programming Guide", | |
// 3rd edition, pp 106, glLoadMatrix). | |
float _11, _21, _31, _41; | |
float _12, _22, _32, _42; | |
float _13, _23, _33, _43; | |
float _14, _24, _34, _44; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Returns: INTERSECT : 0 | |
// INSIDE : 1 | |
// OUTSIDE : 2 | |
int FrustumAABBIntersect(Plane *planes, Vector &mins, Vector &maxs) { | |
int ret = INSIDE; | |
Vector vmin, vmax; | |
for(int i = 0; i < 6; ++i) { | |
// X axis | |
if(planes[i].normal.x > 0) { |