// // Created by 14727 on 2022/12/11. // #ifndef NURBSEVALUATOR_AABB_CUH #define NURBSEVALUATOR_AABB_CUH #include "vec.cuh" #include "glm/glm.hpp" #include "cstdio" class AABB { public: // 边界 glm::vec3 pMin, pMax; __device__ __host__ AABB(); __device__ __host__ explicit AABB(const glm::vec3& p); __device__ __host__ AABB(const glm::vec3& p1, const glm::vec3& p2); // aabb包围盒合并操作,包围盒和点 __device__ __host__ AABB Union(const glm::vec3& p) const; // aabb包围盒合并操作,两个包围盒 __device__ __host__ AABB Union(const AABB& b2) const; // aabb包围盒沿各坐标轴政府方向分别扩张 __device__ __host__ void expand(float k); // 判断两个aabb包围盒是否重叠 __device__ __host__ bool IsOverlap(const AABB& b2) const; }; #endif //NURBSEVALUATOR_AABB_CUH