//============================================================================ // aabbtree.hpp //============================================================================ #ifndef _AABBTREE_ #define _AABBTREE_ #include "common.hpp" #include "bvtree.hpp" class AABBtree : public BVtree { private: // TREE OPERATIONS void BuildHierarchy(); void FindTightFit(); int Subdivide(); // AABB VERTS (in order: RTN,LTN,LBN,RBN,RTF,LTF,LBF,RBF) static Vect3d aabbV[8]; public: // NODE (BV) OPERATIONS int OverlapPlane(Plane P) const; int EdgeIntersect(Vect3d Start, Vect3d End) const; int RayIntersect(Vect3d Start, Vect3d Dir, float& InT, float& OutT) const; int OverlapVF(ViewFrustum* VF) const; Vect3d MinExt, MaxExt; // MIN/MAX EXTENTS OF AABB (IN WORLD COORDS) AABBtree() : BVtree() {}; AABBtree(PtSetObjList* OL, int minobjs=10) : BVtree(minobjs) { printf("copying PtSetObjList. . ."); CopyPtSetObjList(OL); printf("DONE!\n"); printf("building AABBtree. . ."); BuildHierarchy(); printf("DONE!\n"); printf("freeing objects, extracting IDs. . ."); PtSetObjListToIDs(); printf("DONE!\n"); }; }; #endif