// // Created by 14727 on 2022/12/11. // #ifndef NURBSEVALUATOR_BVH_CUH #define NURBSEVALUATOR_BVH_CUH #include "../aabb.cuh" struct BVHNode { AABB bounds; // AABB包围盒 int firstChild, level, childNum = 4; // 第一个孩子节点的下标,该结点所在层次,孩子个数 // 曲面片u, v的范围 float u0, u1, v0, v1; }; class BVH { public: int maxLevel, size; BVHNode* nodes = nullptr; __host__ void printQuadTree(); }; __global__ void buildSurfaceBvh(const float *k, int level, const float *evaluatedPoints, float d_lastKnot_u, float d_lastKnot_v, int d_sampleCnt_u, int d_sampleCnt_v, BVHNode *BVH); #endif //NURBSEVALUATOR_BVH_CUH