#include #include #include #include "lin_alg.h" #include "entity.h" #include "color.h" #include "light.h" #define GRID_SIZEX 60 #define GRID_SIZEY 60 #define GRID_SIZEZ 60 struct IntersectInfo { double param_t; vector3d pt; vector3d norm; Color col; Entity * E; }; class world_objects { public: world_objects() {grid = 0;} ~world_objects() {delete [] grid;} std::vector objects; std::vector lights; void Insert(Entity*E) {objects.push_back(E);} void PathCompress(); // IntersectInfo CalcRayIntersect(Ray ray, int flags, float contrib); int IntersectionTest(Ray ray, int flags); IntersectInfo CalcRayIntersectBucket(Ray ray, int flags, float contrib, double depth); int IntersectionTestBucket(Ray ray, int flags); void SetupBuckets(); std::list (*grid)[GRID_SIZEY][GRID_SIZEZ]; vector3d base, diff, top; };