19#define USE_KDOPBVH_WATERTIGHT
58#ifdef USE_KDOPBVH_WATERTIGHT
89#define BVH_RAYCAST_DEFAULT (BVH_RAYCAST_WATERTIGHT)
90#define BVH_RAYCAST_DIST_MAX (FLT_MAX / 2.0f)
124 const float (*clip_plane)[4],
154 BVHTree *
tree,
int index,
const float co[3],
const float co_moving[3],
int numpoints);
181 uint max_interactions,
185 unsigned int *r_overlap_num,
193 unsigned int *r_overlap_num,
283 const float light_start[3],
284 const float light_end[3],
300 float (*clip_planes)[4],
331 fn(index, *ray, *hit);
347 [](
void *userdata,
const int index,
const float co[3],
const float dist_sq) {
349 fn(index, co, dist_sq);
BVHTree * BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
int * BLI_bvhtree_intersect_plane(const BVHTree *tree, float plane[4], uint *r_intersect_num)
int BLI_bvhtree_get_tree_type(const BVHTree *tree)
void BLI_bvhtree_get_bounding_box(const BVHTree *tree, float r_bb_min[3], float r_bb_max[3])
int BLI_bvhtree_find_nearest_projected(const BVHTree *tree, float projmat[4][4], float winsize[2], float mval[2], float(*clip_planes)[4], int clip_plane_len, BVHTreeNearest *nearest, BVHTree_NearestProjectedCallback callback, void *userdata)
const float bvhtree_kdop_axes[13][3]
bool(*)(void *userdata, int index_a, int index_b, int thread) BVHTree_OverlapCallback
void(*)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) BVHTree_RayCastCallback
@ BVH_OVERLAP_USE_THREADING
@ BVH_OVERLAP_RETURN_PAIRS
void BLI_bvhtree_balance(BVHTree *tree)
void BLI_bvhtree_update_tree(BVHTree *tree)
float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3])
void BLI_bvhtree_ray_cast_all_ex(const BVHTree *tree, const float co[3], const float dir[3], float radius, float hit_dist, BVHTree_RayCastCallback callback, void *userdata, int flag)
void BLI_bvhtree_free(BVHTree *tree)
void BLI_bvhtree_insert(BVHTree *tree, int index, const float co[3], int numpoints)
BVHTreeOverlap * BLI_bvhtree_overlap_ex(const BVHTree *tree1, const BVHTree *tree2, uint *r_overlap_num, BVHTree_OverlapCallback callback, void *userdata, uint max_interactions, int flag)
BVHTreeOverlap * BLI_bvhtree_overlap_self(const BVHTree *tree, unsigned int *r_overlap_num, BVHTree_OverlapCallback callback, void *userdata)
bool BLI_bvhtree_update_node(BVHTree *tree, int index, const float co[3], const float co_moving[3], int numpoints)
void BLI_bvhtree_ray_cast_all(const BVHTree *tree, const float co[3], const float dir[3], float radius, float hit_dist, BVHTree_RayCastCallback callback, void *userdata)
void(*)(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) BVHTree_NearestPointCallback
int BLI_bvhtree_get_len(const BVHTree *tree)
int BLI_bvhtree_overlap_thread_num(const BVHTree *tree)
void(*)(void *userdata, int index, const float co[3], float dist_sq) BVHTree_RangeQuery
int BLI_bvhtree_ray_cast_ex(const BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata, int flag)
int BLI_bvhtree_find_nearest(const BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
float BLI_bvhtree_get_epsilon(const BVHTree *tree)
void(*)(void *userdata, int index, const DistProjectedAABBPrecalc *precalc, const float(*clip_plane)[4], int clip_plane_len, BVHTreeNearest *nearest) BVHTree_NearestProjectedCallback
int BLI_bvhtree_ray_cast(const BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
int BLI_bvhtree_find_nearest_first(const BVHTree *tree, const float co[3], float dist_sq, BVHTree_NearestPointCallback callback, void *userdata)
@ BVH_NEAREST_OPTIMAL_ORDER
int BLI_bvhtree_find_nearest_ex(const BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata, int flag)
int BLI_bvhtree_range_query(const BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata)
BVHTreeOverlap * BLI_bvhtree_overlap(const BVHTree *tree1, const BVHTree *tree2, unsigned int *r_overlap_num, BVHTree_OverlapCallback callback, void *userdata)
void operator()(BVHTree *tree)
FunctionRef< void(int index, const BVHTreeRay &ray, BVHTreeRayHit &hit)> BVHTree_RayCastCallback_CPP
void BLI_bvhtree_range_query_cpp(const BVHTree &tree, const float3 co, float radius, BVHTree_RangeQuery_CPP fn)
FunctionRef< void(int index, const float3 &co, float dist_sq)> BVHTree_RangeQuery_CPP
void BLI_bvhtree_ray_cast_all_cpp(const BVHTree &tree, const float3 co, const float3 dir, float radius, float hit_dist, BVHTree_RayCastCallback_CPP fn)
VecBase< float, 3 > float3
struct IsectRayPrecalc * isect_precalc