![]() |
Dandelion 1.1.1
A light-weight 3D builder for educational usage
|
BVH中的Aligned-axis bounding box 更多...
#include <aabb.h>
Public 成员函数 | |
AABB (const Eigen::Vector3f &p) | |
AABB (const Eigen::Vector3f &p1, const Eigen::Vector3f &p2) | |
Eigen::Vector3f | diagonal () const |
int | max_extent () const |
Eigen::Vector3f | centroid () |
bool | intersect (const Ray &ray, const Eigen::Vector3f &inv_dir, const std::array< int, 3 > &dir_is_neg) |
BVH加速求交的函数调用接口 | |
Public 属性 | |
Eigen::Vector3f | p_min |
Eigen::Vector3f | p_max |
BVH中的Aligned-axis bounding box
Vector3f AABB::centroid | ( | ) |
返回AABB的中心坐标
Vector3f AABB::diagonal | ( | ) | const |
返回p_max和p_min的距离,即AABB對角线的长度
bool AABB::intersect | ( | const Ray & | ray, |
const Eigen::Vector3f & | inv_dir, | ||
const std::array< int, 3 > & | dir_is_neg ) |
BVH加速求交的函数调用接口
ray | 求交的射线 |
inv_dir | (1/dir.x, 1/dir.y, 1/dir.z),乘法比除法快 |
dir_is_neg | 判断x,y,z方向是否为负,为负则交换t_min和t_max |
int AABB::max_extent | ( | ) | const |
返回AABB的x,y,z中最长的一维
Eigen::Vector3f AABB::p_min |
x,y,z最小的点以及最大的点,两个点即能确定一个AABB