20 #define USE_KDOPBVH_WATERTIGHT
59 #ifdef USE_KDOPBVH_WATERTIGHT
88 #define BVH_RAYCAST_DEFAULT (BVH_RAYCAST_WATERTIGHT)
89 #define BVH_RAYCAST_DIST_MAX (FLT_MAX / 2.0f)
123 const float (*clip_plane)[4],
163 BVHTree *
tree,
int index,
const float co[3],
const float co_moving[3],
int numpoints);
187 uint max_interactions,
191 unsigned int *r_overlap_num,
281 const float light_start[3],
282 const float light_end[3],
295 float clip_planes[6][4],
335 using BVHTree_RayCastCallback_CPP =
338 inline void BLI_bvhtree_ray_cast_all_cpp(
BVHTree &
tree,
343 BVHTree_RayCastCallback_CPP fn)
352 BVHTree_RayCastCallback_CPP fn = *
static_cast<BVHTree_RayCastCallback_CPP *
>(userdata);
353 fn(index, *ray, *hit);
358 using BVHTree_RangeQuery_CPP = FunctionRef<
void(
int index,
const float3 &co,
float dist_sq)>;
360 inline void BLI_bvhtree_range_query_cpp(
BVHTree &
tree,
363 BVHTree_RangeQuery_CPP fn)
369 [](
void *userdata,
const int index,
const float co[3],
const float dist_sq) {
370 BVHTree_RangeQuery_CPP fn = *
static_cast<BVHTree_RangeQuery_CPP *
>(userdata);
371 fn(index, co, dist_sq);
typedef float(TangentPoint)[2]
struct BVHTreeNearest BVHTreeNearest
int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata)
@ BVH_OVERLAP_USE_THREADING
@ BVH_OVERLAP_RETURN_PAIRS
struct BVHTreeOverlap BVHTreeOverlap
int BLI_bvhtree_get_tree_type(const BVHTree *tree)
void BLI_bvhtree_ray_cast_all_ex(BVHTree *tree, const float co[3], const float dir[3], float radius, float hit_dist, BVHTree_RayCastCallback callback, void *userdata, int flag)
int BLI_bvhtree_find_nearest_ex(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata, int flag)
int BLI_bvhtree_find_nearest_first(BVHTree *tree, const float co[3], float dist_sq, BVHTree_NearestPointCallback callback, void *userdata)
BVHTreeOverlap * BLI_bvhtree_overlap(const BVHTree *tree1, const BVHTree *tree2, unsigned int *r_overlap_num, BVHTree_OverlapCallback callback, void *userdata)
const float bvhtree_kdop_axes[13][3]
void BLI_bvhtree_balance(BVHTree *tree)
BVHTree * BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
void BLI_bvhtree_update_tree(BVHTree *tree)
int BLI_bvhtree_ray_cast_ex(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_projected(BVHTree *tree, float projmat[4][4], float winsize[2], float mval[2], float clip_planes[6][4], int clip_plane_len, BVHTreeNearest *nearest, BVHTree_NearestProjectedCallback callback, void *userdata)
float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3])
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)
bool(* BVHTree_WalkLeafCallback)(const BVHTreeAxisRange *bounds, int index, void *userdata)
void BLI_bvhtree_free(BVHTree *tree)
bool(* BVHTree_WalkOrderCallback)(const BVHTreeAxisRange *bounds, char axis, void *userdata)
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)
@ BVH_NEAREST_OPTIMAL_ORDER
bool BLI_bvhtree_update_node(BVHTree *tree, int index, const float co[3], const float co_moving[3], int numpoints)
void BLI_bvhtree_walk_dfs(BVHTree *tree, BVHTree_WalkParentCallback walk_parent_cb, BVHTree_WalkLeafCallback walk_leaf_cb, BVHTree_WalkOrderCallback walk_order_cb, void *userdata)
int BLI_bvhtree_get_len(const BVHTree *tree)
bool(* BVHTree_WalkParentCallback)(const BVHTreeAxisRange *bounds, void *userdata)
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_intersect_plane(BVHTree *tree, float plane[4], uint *r_intersect_num)
struct BVHTreeAxisRange BVHTreeAxisRange
struct BVHTreeRayHit BVHTreeRayHit
float BLI_bvhtree_get_epsilon(const BVHTree *tree)
struct BVHTreeRay BVHTreeRay
void BLI_bvhtree_get_bounding_box(BVHTree *tree, float r_bb_min[3], float r_bb_max[3])
void BLI_bvhtree_ray_cast_all(BVHTree *tree, const float co[3], const float dir[3], float radius, float hit_dist, BVHTree_RayCastCallback callback, void *userdata)
int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
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_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
DEGForeachIDComponentCallback callback
SyclQueue void void size_t num_bytes void
struct IsectRayPrecalc * isect_precalc