21#define USE_KDOPBVH_WATERTIGHT
60#ifdef USE_KDOPBVH_WATERTIGHT
91#define BVH_RAYCAST_DEFAULT (BVH_RAYCAST_WATERTIGHT)
92#define BVH_RAYCAST_DIST_MAX (FLT_MAX / 2.0f)
126 const float (*clip_plane)[4],
147 BVHTree *
tree,
int index,
const float co[3],
const float co_moving[3],
int numpoints);
174 uint max_interactions,
178 unsigned int *r_overlap_num,
186 unsigned int *r_overlap_num,
276 const float light_start[3],
277 const float light_end[3],
293 float (*clip_planes)[4],
315using BVHTree_RayCastCallback_CPP =
318inline void BLI_bvhtree_ray_cast_all_cpp(
const BVHTree &
tree,
323 BVHTree_RayCastCallback_CPP fn)
332 BVHTree_RayCastCallback_CPP fn = *
static_cast<BVHTree_RayCastCallback_CPP *
>(userdata);
333 fn(index, *ray, *hit);
338using BVHTree_RangeQuery_CPP = FunctionRef<void(
int index,
const float3 &co,
float dist_sq)>;
340inline void BLI_bvhtree_range_query_cpp(
const BVHTree &
tree,
343 BVHTree_RangeQuery_CPP fn)
349 [](
void *userdata,
const int index,
const float co[3],
const float dist_sq) {
350 BVHTree_RangeQuery_CPP fn = *
static_cast<BVHTree_RangeQuery_CPP *
>(userdata);
351 fn(index, co, dist_sq);
struct BVHTreeNearest BVHTreeNearest
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)
@ BVH_OVERLAP_USE_THREADING
@ BVH_OVERLAP_RETURN_PAIRS
struct BVHTreeOverlap BVHTreeOverlap
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])
@ BVH_NEAREST_OPTIMAL_ORDER
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]
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(* BVHTree_RayCastCallback)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
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)
int BLI_bvhtree_get_len(const BVHTree *tree)
int BLI_bvhtree_overlap_thread_num(const BVHTree *tree)
void(* BVHTree_NearestPointCallback)(void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
bool(* BVHTree_OverlapCallback)(void *userdata, int index_a, int index_b, int thread)
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)
struct BVHTreeAxisRange BVHTreeAxisRange
struct BVHTreeRayHit BVHTreeRayHit
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)
struct BVHTreeRay BVHTreeRay
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)
int BLI_bvhtree_find_nearest_ex(const BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata, int flag)
void(* BVHTree_RangeQuery)(void *userdata, int index, const float co[3], float dist_sq)
void(* BVHTree_NearestProjectedCallback)(void *userdata, int index, const struct DistProjectedAABBPrecalc *precalc, const float(*clip_plane)[4], int clip_plane_len, BVHTreeNearest *nearest)
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)
DEGForeachIDComponentCallback callback
draw_view in_light_buf[] float
struct IsectRayPrecalc * isect_precalc