Dandelion 1.1.1
A light-weight 3D builder for educational usage
|
Public 成员函数 | |
BVH (const GL::Mesh &mesh) | |
BVH加速结构的构造函数 | |
void | build () |
void | recursively_delete (BVHNode *node) |
size_t | count_nodes (BVHNode *node) |
std::optional< Intersection > | intersect (const Ray &ray, const GL::Mesh &mesh, const Eigen::Matrix4f obj_model) |
BVH加速求交的函数调用接口 | |
std::optional< Intersection > | ray_node_intersect (BVHNode *node, const Ray &ray) const |
获取BVH求交的结果 | |
BVHNode * | recursively_build (std::vector< size_t > faces_idx) |
Public 属性 | |
BVHNode * | root |
const GL::Mesh & | mesh |
std::vector< size_t > | primitives |
Eigen::Matrix4f | model |
BVH::BVH | ( | const GL::Mesh & | mesh | ) |
BVH加速结构的构造函数
传入当前mesh的类型
mesh_type | mesh的类型 |
void BVH::build | ( | ) |
建立整个object的bvh的函数调用接口
size_t BVH::count_nodes | ( | BVHNode * | node | ) |
统计当前bvh的节点总数
optional< Intersection > BVH::intersect | ( | const Ray & | ray, |
const GL::Mesh & | mesh, | ||
const Eigen::Matrix4f | obj_model ) |
BVH加速求交的函数调用接口
ray | 求交的射线 |
mesh | 当前的mesh |
obj_model | 当前mesh所在object的model矩阵 |
optional< Intersection > BVH::ray_node_intersect | ( | BVHNode * | node, |
const Ray & | ray ) const |
获取BVH求交的结果
node | 求交的节点 |
ray | 求交的射线 |
BVHNode * BVH::recursively_build | ( | std::vector< size_t > | faces_idx | ) |
建立整个object的bvh的函数具体实现,边界条件为覆盖的面片数<=1
void BVH::recursively_delete | ( | BVHNode * | node | ) |
删除建立的整个bvh
const GL::Mesh& BVH::mesh |
当前bvh所在object的mesh
Eigen::Matrix4f BVH::model |
当前bvh所在object的model矩阵
std::vector<size_t> BVH::primitives |
当前mesh的所有图元索引
BVHNode* BVH::root |
整个bvh的根节点