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.
 
 
 

35 lines
833 B

//
// Created by 14727 on 2022/12/11.
//
#ifndef NURBSEVALUATOR_BVH_CUH
#define NURBSEVALUATOR_BVH_CUH
#include "device/aabb.cuh"
/**
* 当前层的第一个节点的坐标
* @param layer 层号。根节点为第一层
*/
__device__ __host__ int getStartIdxOfLayerN(int layer);
/**
* 根据u、v参数域中的小矩形的位置,判断它在BVH叶节点层(也就是最后一层)中的位置
*/
__device__ int d_getChildNodeIdx(int ix, int iy);
__host__ int h_getChildNodeIdx(int ix, int iy);
class BVH {
public:
int maxLevel, size;
BVHNode *nodes = nullptr;
__host__ void printQuadTree();
};
__global__ void
buildBvh(const float *k, int level, const float *evaluatedPoints, float lastKnot_u, float lastKnot_v,
int sampleCnt_u, int sampleCnt_v, BVHNode *BVH);
#endif //NURBSEVALUATOR_BVH_CUH