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.

36 lines
833 B

2 years ago
//
// Created by 14727 on 2022/12/11.
//
#ifndef NURBSEVALUATOR_BVH_CUH
#define NURBSEVALUATOR_BVH_CUH
2 years ago
#include "device/aabb.cuh"
2 years ago
2 years ago
/**
* 当前层的第一个节点的坐标
* @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);
2 years ago
class BVH {
public:
int maxLevel, size;
2 years ago
BVHNode *nodes = nullptr;
2 years ago
__host__ void printQuadTree();
};
__global__ void
2 years ago
buildBvh(const float *k, int level, const float *evaluatedPoints, float lastKnot_u, float lastKnot_v,
int sampleCnt_u, int sampleCnt_v, BVHNode *BVH);
2 years ago
#endif //NURBSEVALUATOR_BVH_CUH