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.

30 lines
701 B

2 years ago
//
// 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