Blender V2.61 - r43446
|
#include <float.h>
Go to the source code of this file.
Classes | |
struct | BVHTreeOverlap |
struct | BVHTreeNearest |
struct | BVHTreeRay |
struct | BVHTreeRayHit |
Typedefs | |
typedef struct BVHTree | BVHTree |
typedef struct BVHTreeOverlap | BVHTreeOverlap |
typedef struct BVHTreeNearest | BVHTreeNearest |
typedef struct BVHTreeRay | BVHTreeRay |
typedef struct BVHTreeRayHit | BVHTreeRayHit |
typedef void(* | BVHTree_NearestPointCallback )(void *userdata, int index, const float *co, BVHTreeNearest *nearest) |
typedef void(* | BVHTree_RayCastCallback )(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) |
typedef void(* | BVHTree_RangeQuery )(void *userdata, int index, float squared_dist) |
Functions | |
BVHTree * | BLI_bvhtree_new (int maxsize, float epsilon, char tree_type, char axis) |
void | BLI_bvhtree_free (BVHTree *tree) |
int | BLI_bvhtree_insert (BVHTree *tree, int index, const float *co, int numpoints) |
void | BLI_bvhtree_balance (BVHTree *tree) |
int | BLI_bvhtree_update_node (BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints) |
void | BLI_bvhtree_update_tree (BVHTree *tree) |
BVHTreeOverlap * | BLI_bvhtree_overlap (BVHTree *tree1, BVHTree *tree2, unsigned int *result) |
float | BLI_bvhtree_getepsilon (BVHTree *tree) |
int | BLI_bvhtree_find_nearest (BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) |
int | BLI_bvhtree_ray_cast (BVHTree *tree, const float co[3], const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata) |
float | BLI_bvhtree_bb_raycast (float *bv, const float light_start[3], const float light_end[3], float pos[3]) |
int | BLI_bvhtree_range_query (BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata) |
Definition in file BLI_kdopbvh.h.
Definition at line 45 of file BLI_kdopbvh.h.
typedef void(* BVHTree_NearestPointCallback)(void *userdata, int index, const float *co, BVHTreeNearest *nearest) |
Definition at line 76 of file BLI_kdopbvh.h.
typedef void(* BVHTree_RangeQuery)(void *userdata, int index, float squared_dist) |
Definition at line 82 of file BLI_kdopbvh.h.
typedef void(* BVHTree_RayCastCallback)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) |
Definition at line 79 of file BLI_kdopbvh.h.
typedef struct BVHTreeNearest BVHTreeNearest |
typedef struct BVHTreeOverlap BVHTreeOverlap |
typedef struct BVHTreeRay BVHTreeRay |
typedef struct BVHTreeRayHit BVHTreeRayHit |
void BLI_bvhtree_balance | ( | BVHTree * | tree | ) |
Definition at line 953 of file BLI_kdopbvh.c.
References assert, build_skip_links(), i, implicit_needed_branches(), BVHTree::nodearray, BVHTree::nodes, non_recursive_bvh_div_nodes(), NULL, BVHTree::totbranch, BVHTree::totleaf, and BVHTree::tree_type.
Referenced by bvhselftree_build_from_cloth(), bvhtree_build_from_cloth(), bvhtree_build_from_mvert(), bvhtree_from_mesh_edges(), bvhtree_from_mesh_faces(), bvhtree_from_mesh_verts(), heat_ray_tree_create(), pointdensity_cache_object(), pointdensity_cache_psys(), psys_update_particle_bvhtree(), and RE_rayobject_blibvh_done().
float BLI_bvhtree_bb_raycast | ( | float * | bv, |
const float | light_start[3], | ||
const float | light_end[3], | ||
float | pos[3] | ||
) |
Definition at line 1623 of file BLI_kdopbvh.c.
References copy_v3_v3(), data, BVHTreeRay::direction, BVHTreeRayHit::dist, FLT_MAX, BVHRayCastData::hit, madd_v3_v3v3fl(), normalize_v3(), BVHTreeRay::origin, BVHTreeRay::radius, BVHRayCastData::ray, BVHRayCastData::ray_dot_axis, and ray_nearest_hit().
int BLI_bvhtree_find_nearest | ( | BVHTree * | tree, |
const float | co[3], | ||
BVHTreeNearest * | nearest, | ||
BVHTree_NearestPointCallback | callback, | ||
void * | userdata | ||
) |
Definition at line 1380 of file BLI_kdopbvh.c.
References BVHNearestData::callback, co, BVHNearestData::co, data, dfs_find_nearest_begin(), BVHTreeNearest::dist, dot_v3v3(), FLT_MAX, i, BVHTreeNearest::index, KDOP_AXES, BVHNearestData::nearest, BVHTree::nodes, BVHNearestData::proj, MakeCursor::root, BVHTree::start_axis, BVHTree::stop_axis, BVHTree::totleaf, BVHNearestData::tree, and BVHNearestData::userdata.
Referenced by closest_point_on_surface(), connect_hair(), dynamicPaint_paintMesh(), get_vert2geom_distance(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), and shrinkwrap_get_tarmat().
void BLI_bvhtree_free | ( | BVHTree * | tree | ) |
Definition at line 941 of file BLI_kdopbvh.c.
References MEM_freeN(), BVHTree::nodearray, BVHTree::nodebv, BVHTree::nodechild, and BVHTree::nodes.
Referenced by BKE_free_pointdensitydata(), bvhcacheitem_free(), cache_pointdensity(), cloth_free_modifier(), cloth_free_modifier_extern(), deformVerts(), free_bvhtree_from_mesh(), free_pointdensity(), freeData(), heat_system_free(), psys_free(), psys_update_particle_bvhtree(), RE_rayobject_blibvh_free(), smokeModifier_freeCollision(), and smokeModifier_reset().
float BLI_bvhtree_getepsilon | ( | BVHTree * | tree | ) |
Definition at line 1048 of file BLI_kdopbvh.c.
References BVHTree::epsilon.
Referenced by cloth_collision(), cloth_collision_response_static(), and deformVerts().
int BLI_bvhtree_insert | ( | BVHTree * | tree, |
int | index, | ||
const float * | co, | ||
int | numpoints | ||
) |
Definition at line 976 of file BLI_kdopbvh.c.
References BVHNode::bv, create_kdop_hull(), BVHTree::epsilon, i, BVHNode::index, MEM_allocN_len(), BVHTree::nodearray, BVHTree::nodes, NULL, BVHTree::start_axis, BVHTree::totbranch, and BVHTree::totleaf.
Referenced by bvhselftree_build_from_cloth(), bvhtree_build_from_cloth(), bvhtree_build_from_mvert(), bvhtree_from_mesh_edges(), bvhtree_from_mesh_faces(), bvhtree_from_mesh_verts(), heat_ray_tree_create(), pointdensity_cache_object(), pointdensity_cache_psys(), psys_update_particle_bvhtree(), and RE_rayobject_blibvh_add().
BVHTree* BLI_bvhtree_new | ( | int | maxsize, |
float | epsilon, | ||
char | tree_type, | ||
char | axis | ||
) |
Definition at line 835 of file BLI_kdopbvh.c.
References BVHTree::axis, BVHNode::bv, BVHNode::children, KDL::epsilon, BVHTree::epsilon, i, implicit_needed_branches(), MAX2, MAX_TREETYPE, MEM_callocN(), MEM_freeN(), BVHTree::nodearray, BVHTree::nodebv, BVHTree::nodechild, BVHTree::nodes, NULL, BVHTree::start_axis, BVHTree::stop_axis, and BVHTree::tree_type.
Referenced by bvhselftree_build_from_cloth(), bvhtree_build_from_cloth(), bvhtree_build_from_mvert(), bvhtree_from_mesh_edges(), bvhtree_from_mesh_faces(), bvhtree_from_mesh_verts(), heat_ray_tree_create(), pointdensity_cache_object(), pointdensity_cache_psys(), psys_update_particle_bvhtree(), and RE_rayobject_blibvh_create().
BVHTreeOverlap* BLI_bvhtree_overlap | ( | BVHTree * | tree1, |
BVHTree * | tree2, | ||
unsigned int * | result | ||
) |
Definition at line 1137 of file BLI_kdopbvh.c.
References BVHTree::axis, BVHNode::children, data, addon::engine::free(), BVHOverlapData::i, MAX2, BVHOverlapData::max_overlap, MEM_callocN(), MEM_freeN(), MIN2, BVHTree::nodes, NULL, BVHOverlapData::overlap, BVHTree::start_axis, BVHOverlapData::start_axis, BVHOverlapData::stop_axis, BVHTree::stop_axis, BVHTree::totleaf, BVHNode::totnode, traverse(), BVHOverlapData::tree1, BVHOverlapData::tree2, tree_overlap(), and BVHTree::tree_type.
Referenced by cloth_bvh_objcollision().
int BLI_bvhtree_range_query | ( | BVHTree * | tree, |
const float | co[3], | ||
float | radius, | ||
BVHTree_RangeQuery | callback, | ||
void * | userdata | ||
) |
Definition at line 1709 of file BLI_kdopbvh.c.
References calc_nearest_point(), RangeQueryData::callback, RangeQueryData::center, co, data, dfs_range_query(), RangeQueryData::hits, BVHNode::index, BVHTree::nodes, NULL, RangeQueryData::radius, MakeCursor::root, BVHTree::totleaf, BVHNode::totnode, RangeQueryData::tree, and RangeQueryData::userdata.
Referenced by pointdensitytex(), and sph_force_cb().
int BLI_bvhtree_ray_cast | ( | BVHTree * | tree, |
const float | co[3], | ||
const float * | dir, | ||
float | radius, | ||
BVHTreeRayHit * | hit, | ||
BVHTree_RayCastCallback | callback, | ||
void * | userdata | ||
) |
int BLI_bvhtree_update_node | ( | BVHTree * | tree, |
int | index, | ||
const float * | co, | ||
const float * | co_moving, | ||
int | numpoints | ||
) |
Definition at line 1008 of file BLI_kdopbvh.c.
References BVHNode::bv, create_kdop_hull(), BVHTree::epsilon, i, BVHTree::nodearray, NULL, BVHTree::start_axis, and BVHTree::totleaf.
Referenced by bvhselftree_update_from_cloth(), bvhtree_update_from_cloth(), and bvhtree_update_from_mvert().
void BLI_bvhtree_update_tree | ( | BVHTree * | tree | ) |
Definition at line 1035 of file BLI_kdopbvh.c.
References node_join(), BVHTree::nodes, MakeCursor::root, BVHTree::totbranch, and BVHTree::totleaf.
Referenced by bvhselftree_update_from_cloth(), bvhtree_update_from_cloth(), and bvhtree_update_from_mvert().