// // Created by dtouch on 23-5-14. // #ifndef RENDERSDF_BVH_H #define RENDERSDF_BVH_H #include "aabb.h" #include "rod.h" #include "vector" typedef struct BVHNode { AABB box; BVHNode *left{}; BVHNode *right{}; // int start{}; // start index of the triangle list // int end{}; // end index of the triangle list // int rodCnt; std::vector rods; } BVHNode; class RodBVH { int maxDepth{}; int maxLeafSize{}; BVHNode *root{}; RodCrystal rodCrystal; public: explicit RodBVH(RodCrystal _rodCrystal); void build(); private: void recursiveBuild(BVHNode*node); void quickSelect(std::vector& rods, int axis); }; #endif //RENDERSDF_BVH_H