A tool for evaluating multiple NURBS curve/surface points using the GPU.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
865 B

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