|
Blender
V2.93
|
Go to the source code of this file.
Classes | |
| struct | BVHTreeFromEditMesh |
| struct | BVHTreeFromMesh |
| struct | BVHTreeFromPointCloud |
Typedefs | |
| typedef struct BVHTreeFromEditMesh | BVHTreeFromEditMesh |
| typedef struct BVHTreeFromMesh | BVHTreeFromMesh |
| typedef enum BVHCacheType | BVHCacheType |
| typedef struct BVHTreeFromPointCloud | BVHTreeFromPointCloud |
Functions | |
| BVHTree * | bvhtree_from_editmesh_verts (BVHTreeFromEditMesh *data, struct BMEditMesh *em, float epsilon, int tree_type, int axis) |
| BVHTree * | bvhtree_from_editmesh_verts_ex (BVHTreeFromEditMesh *data, struct BMEditMesh *em, const BLI_bitmap *mask, int verts_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | bvhtree_from_mesh_verts_ex (struct BVHTreeFromMesh *data, const struct MVert *vert, const int verts_num, const bool vert_allocated, const BLI_bitmap *mask, int verts_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | bvhtree_from_editmesh_edges (BVHTreeFromEditMesh *data, struct BMEditMesh *em, float epsilon, int tree_type, int axis) |
| BVHTree * | bvhtree_from_editmesh_edges_ex (BVHTreeFromEditMesh *data, struct BMEditMesh *em, const BLI_bitmap *edges_mask, int edges_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | bvhtree_from_mesh_edges_ex (struct BVHTreeFromMesh *data, const struct MVert *vert, const bool vert_allocated, const struct MEdge *edge, const int edges_num, const bool edge_allocated, const BLI_bitmap *edges_mask, int edges_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | bvhtree_from_mesh_faces_ex (struct BVHTreeFromMesh *data, const struct MVert *vert, const bool vert_allocated, const struct MFace *face, const int numFaces, const bool face_allocated, const BLI_bitmap *mask, int faces_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | bvhtree_from_editmesh_looptri (BVHTreeFromEditMesh *data, struct BMEditMesh *em, float epsilon, int tree_type, int axis) |
| BVHTree * | bvhtree_from_editmesh_looptri_ex (BVHTreeFromEditMesh *data, struct BMEditMesh *em, const BLI_bitmap *mask, int looptri_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | bvhtree_from_mesh_looptri_ex (struct BVHTreeFromMesh *data, const struct MVert *vert, const bool vert_allocated, const struct MLoop *mloop, const bool loop_allocated, const struct MLoopTri *looptri, const int looptri_num, const bool looptri_allocated, const BLI_bitmap *mask, int looptri_num_active, float epsilon, int tree_type, int axis, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| BVHTree * | BKE_bvhtree_from_mesh_get (struct BVHTreeFromMesh *data, struct Mesh *mesh, const BVHCacheType bvh_cache_type, const int tree_type) |
| BVHTree * | BKE_bvhtree_from_editmesh_get (BVHTreeFromEditMesh *data, struct BMEditMesh *em, const int tree_type, const BVHCacheType bvh_cache_type, struct BVHCache **bvh_cache_p, ThreadMutex *mesh_eval_mutex) |
| void | free_bvhtree_from_editmesh (struct BVHTreeFromEditMesh *data) |
| void | free_bvhtree_from_mesh (struct BVHTreeFromMesh *data) |
| float | bvhtree_ray_tri_intersection (const BVHTreeRay *ray, const float m_dist, const float v0[3], const float v1[3], const float v2[3]) |
| float | bvhtree_sphereray_tri_intersection (const BVHTreeRay *ray, float radius, const float m_dist, const float v0[3], const float v1[3], const float v2[3]) |
| BVHTree * | BKE_bvhtree_from_pointcloud_get (struct BVHTreeFromPointCloud *data, const struct PointCloud *pointcloud, const int tree_type) |
| void | free_bvhtree_from_pointcloud (struct BVHTreeFromPointCloud *data) |
| bool | bvhcache_has_tree (const struct BVHCache *bvh_cache, const BVHTree *tree) |
| struct BVHCache * | bvhcache_init (void) |
| void | bvhcache_free (struct BVHCache *bvh_cache) |
| typedef enum BVHCacheType BVHCacheType |
| typedef struct BVHTreeFromEditMesh BVHTreeFromEditMesh |
Struct that stores basic information about a BVHTree built from a edit-mesh.
| typedef struct BVHTreeFromMesh BVHTreeFromMesh |
Struct that stores basic information about a BVHTree built from a mesh.
| typedef struct BVHTreeFromPointCloud BVHTreeFromPointCloud |
| enum BVHCacheType |
Definition at line 89 of file BKE_bvhutils.h.
| BVHTree* BKE_bvhtree_from_editmesh_get | ( | BVHTreeFromEditMesh * | data, |
| struct BMEditMesh * | em, | ||
| const int | tree_type, | ||
| const BVHCacheType | bvh_cache_type, | ||
| BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
Builds or queries a bvhcache for the cache bvhtree of the request type.
Definition at line 1599 of file bvhutils.c.
References BLI_assert, BLI_bvhtree_get_tree_type(), bvhcache_find(), BVHTREE_FROM_EDGES, bvhtree_from_editmesh_edges_ex(), bvhtree_from_editmesh_looptri_ex(), bvhtree_from_editmesh_verts_ex(), BVHTREE_FROM_EM_EDGES, BVHTREE_FROM_EM_LOOPTRI, BVHTREE_FROM_EM_VERTS, BVHTREE_FROM_FACES, BVHTREE_FROM_LOOPTRI, BVHTREE_FROM_LOOPTRI_NO_HIDDEN, BVHTREE_FROM_LOOSEEDGES, BVHTREE_FROM_LOOSEVERTS, BVHTREE_FROM_VERTS, BVHTREE_MAX_ITEM, data, editmesh_looptri_nearest_point(), editmesh_looptri_spherecast(), editmesh_verts_spherecast(), free_bvhtree_from_editmesh(), NULL, and tree.
Referenced by raycastEditMesh(), and snapEditMesh().
| BVHTree* BKE_bvhtree_from_mesh_get | ( | struct BVHTreeFromMesh * | data, |
| struct Mesh * | mesh, | ||
| const BVHCacheType | bvh_cache_type, | ||
| const int | tree_type | ||
| ) |
Builds or queries a bvhcache for the cache bvhtree of the request type.
Definition at line 1413 of file bvhutils.c.
References BKE_mesh_runtime_looptri_ensure(), BKE_mesh_runtime_looptri_len(), BLI_assert, BLI_bvhtree_get_tree_type(), Mesh_Runtime::bvh_cache, bvhcache_find(), BVHTREE_FROM_EDGES, BVHTREE_FROM_EM_EDGES, BVHTREE_FROM_EM_LOOPTRI, BVHTREE_FROM_EM_VERTS, BVHTREE_FROM_FACES, BVHTREE_FROM_LOOPTRI, BVHTREE_FROM_LOOPTRI_NO_HIDDEN, BVHTREE_FROM_LOOSEEDGES, BVHTREE_FROM_LOOSEVERTS, bvhtree_from_mesh_edges_ex(), bvhtree_from_mesh_edges_setup_data(), bvhtree_from_mesh_faces_ex(), bvhtree_from_mesh_faces_setup_data(), bvhtree_from_mesh_looptri_ex(), bvhtree_from_mesh_looptri_setup_data(), bvhtree_from_mesh_verts_ex(), bvhtree_from_mesh_verts_setup_data(), BVHTREE_FROM_VERTS, BVHTREE_MAX_ITEM, data, Mesh_Runtime::eval_mutex, free_bvhtree_from_mesh(), looptri_no_hidden_map_get(), loose_edges_map_get(), loose_verts_map_get(), Mesh::medge, MEM_freeN, mesh, Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, Mesh::runtime, Mesh::totedge, Mesh::totface, Mesh::totpoly, Mesh::totvert, and tree.
Referenced by BKE_mesh_remap_calc_difference_from_mesh(), BKE_mesh_remap_calc_edges_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remap_calc_polys_from_mesh(), BKE_mesh_remap_calc_verts_from_mesh(), BKE_mesh_remesh_reproject_paint_mask(), BKE_remesh_reproject_sculpt_face_sets(), BKE_remesh_reproject_vertex_paint(), BKE_shrinkwrap_init_tree(), blender::nodes::bvh_from_mesh(), cloth_build_springs(), deformVerts(), dynamicPaint_paintMesh(), followtrack_project_to_depth_object_if_needed(), get_vert2geom_distance(), harmonic_coordinates_bind(), PE_create_shape_tree(), raycastMesh(), RE_bake_pixels_populate_from_objects(), remap_hair_emitter(), snapMesh(), statvis_calc_intersect(), statvis_calc_thickness(), and surfacedeformBind().
| BVHTree* BKE_bvhtree_from_pointcloud_get | ( | struct BVHTreeFromPointCloud * | data, |
| const struct PointCloud * | pointcloud, | ||
| const int | tree_type | ||
| ) |
Referenced by blender::nodes::bvh_from_pointcloud().
| void bvhcache_free | ( | BVHCache * | bvh_cache | ) |
frees a bvhcache
Definition at line 152 of file bvhutils.c.
References BLI_bvhtree_free(), BLI_mutex_end(), BVHTREE_MAX_ITEM, BVHCache::items, MEM_freeN, BVHCache::mutex, NULL, and BVHCacheItem::tree.
Referenced by BKE_mesh_runtime_clear_geometry().
Referenced by raycastMesh(), snap_object_data_editmesh_get(), and snapMesh().
| struct BVHCache* bvhcache_init | ( | void | ) |
Definition at line 127 of file bvhutils.c.
References BLI_mutex_init(), MEM_callocN, and BVHCache::mutex.
Referenced by bvhcache_find().
| BVHTree* bvhtree_from_editmesh_edges | ( | BVHTreeFromEditMesh * | data, |
| struct BMEditMesh * | em, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis | ||
| ) |
Definition at line 889 of file bvhutils.c.
References bvhtree_from_editmesh_edges_ex(), data, blender::robust_pred::epsilon, and NULL.
| BVHTree* bvhtree_from_editmesh_edges_ex | ( | BVHTreeFromEditMesh * | data, |
| struct BMEditMesh * | em, | ||
| const BLI_bitmap * | edges_mask, | ||
| int | edges_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| struct BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
Definition at line 843 of file bvhutils.c.
References bvhcache_find(), bvhcache_insert(), bvhcache_unlock(), bvhtree_from_editmesh_edges_create_tree(), data, blender::robust_pred::epsilon, NULL, and tree.
Referenced by BKE_bvhtree_from_editmesh_get(), bvhtree_from_editmesh_edges(), and snapEditMesh().
| BVHTree* bvhtree_from_editmesh_looptri | ( | BVHTreeFromEditMesh * | data, |
| struct BMEditMesh * | em, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis | ||
| ) |
Definition at line 1258 of file bvhutils.c.
References bvhtree_from_editmesh_looptri_ex(), data, blender::robust_pred::epsilon, and NULL.
| BVHTree* bvhtree_from_editmesh_looptri_ex | ( | BVHTreeFromEditMesh * | data, |
| BMEditMesh * | em, | ||
| const BLI_bitmap * | looptri_mask, | ||
| int | looptri_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
Builds a bvh tree where nodes are the looptri faces of the given bm
Definition at line 1212 of file bvhutils.c.
References bvhcache_find(), bvhcache_insert(), bvhcache_unlock(), bvhtree_from_editmesh_looptri_create_tree(), data, editmesh_looptri_nearest_point(), editmesh_looptri_spherecast(), blender::robust_pred::epsilon, NULL, and tree.
Referenced by BKE_bvhtree_from_editmesh_get(), bvhtree_from_editmesh_looptri(), and raycastEditMesh().
| BVHTree* bvhtree_from_editmesh_verts | ( | BVHTreeFromEditMesh * | data, |
| struct BMEditMesh * | em, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis | ||
| ) |
Builds a bvh tree where nodes are the relevant elements of the given mesh. Configures BVHTreeFromMesh.
The tree is build in mesh space coordinates, this means special care must be made on queries so that the coordinates and rays are first translated on the mesh local coordinates. Reason for this is that bvh_from_mesh_* can use a cache in some cases and so it becomes possible to reuse a BVHTree.
free_bvhtree_from_mesh should be called when the tree is no longer needed.
Definition at line 677 of file bvhutils.c.
References bvhtree_from_editmesh_verts_ex(), data, blender::robust_pred::epsilon, and NULL.
| BVHTree* bvhtree_from_editmesh_verts_ex | ( | BVHTreeFromEditMesh * | data, |
| struct BMEditMesh * | em, | ||
| const BLI_bitmap * | mask, | ||
| int | verts_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| struct BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
Definition at line 631 of file bvhutils.c.
References bvhcache_find(), bvhcache_insert(), bvhcache_unlock(), bvhtree_from_editmesh_verts_create_tree(), data, editmesh_verts_spherecast(), blender::robust_pred::epsilon, NULL, and tree.
Referenced by BKE_bvhtree_from_editmesh_get(), bvhtree_from_editmesh_verts(), and snapEditMesh().
| BVHTree* bvhtree_from_mesh_edges_ex | ( | struct BVHTreeFromMesh * | data, |
| const struct MVert * | vert, | ||
| const bool | vert_allocated, | ||
| const struct MEdge * | edge, | ||
| const int | edges_num, | ||
| const bool | edge_allocated, | ||
| const BLI_bitmap * | edges_mask, | ||
| int | edges_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| struct BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
| BVHTree* bvhtree_from_mesh_faces_ex | ( | struct BVHTreeFromMesh * | data, |
| const struct MVert * | vert, | ||
| const bool | vert_allocated, | ||
| const struct MFace * | face, | ||
| const int | numFaces, | ||
| const bool | face_allocated, | ||
| const BLI_bitmap * | mask, | ||
| int | faces_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| struct BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
| BVHTree* bvhtree_from_mesh_looptri_ex | ( | BVHTreeFromMesh * | data, |
| const struct MVert * | vert, | ||
| const bool | vert_allocated, | ||
| const struct MLoop * | mloop, | ||
| const bool | loop_allocated, | ||
| const struct MLoopTri * | looptri, | ||
| const int | looptri_num, | ||
| const bool | looptri_allocated, | ||
| const BLI_bitmap * | looptri_mask, | ||
| int | looptri_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
Builds a bvh tree where nodes are the looptri faces of the given dm
Definition at line 1270 of file bvhutils.c.
References bvhcache_find(), bvhcache_insert(), bvhcache_unlock(), bvhtree_from_mesh_looptri_create_tree(), bvhtree_from_mesh_looptri_setup_data(), data, blender::robust_pred::epsilon, NULL, and tree.
Referenced by BKE_bvhtree_from_mesh_get(), and BKE_mesh_remap_calc_loops_from_mesh().
| BVHTree* bvhtree_from_mesh_verts_ex | ( | struct BVHTreeFromMesh * | data, |
| const struct MVert * | vert, | ||
| const int | verts_num, | ||
| const bool | vert_allocated, | ||
| const BLI_bitmap * | mask, | ||
| int | verts_num_active, | ||
| float | epsilon, | ||
| int | tree_type, | ||
| int | axis, | ||
| const BVHCacheType | bvh_cache_type, | ||
| struct BVHCache ** | bvh_cache_p, | ||
| ThreadMutex * | mesh_eval_mutex | ||
| ) |
Referenced by BKE_mesh_remap_calc_loops_from_mesh(), and weldModifier_doWeld().
| float bvhtree_ray_tri_intersection | ( | const BVHTreeRay * | ray, |
| const float | m_dist, | ||
| const float | v0[3], | ||
| const float | v1[3], | ||
| const float | v2[3] | ||
| ) |
Math functions used by callbacks
Referenced by editmesh_looptri_raycast_backface_culling_cb(), mesh_looptri_raycast_backface_culling_cb(), and mesh_tris_spherecast_dp().
| float bvhtree_sphereray_tri_intersection | ( | const BVHTreeRay * | ray, |
| float | radius, | ||
| const float | m_dist, | ||
| const float | v0[3], | ||
| const float | v1[3], | ||
| const float | v2[3] | ||
| ) |
Definition at line 190 of file bvhutils.c.
References BVHTreeRay::direction, isect_sweeping_sphere_tri_v3(), madd_v3_v3v3fl(), BVHTreeRay::origin, v1, and v2.
Referenced by editmesh_looptri_spherecast(), mesh_faces_spherecast(), and mesh_looptri_spherecast().
| void free_bvhtree_from_editmesh | ( | struct BVHTreeFromEditMesh * | data | ) |
Frees data allocated by a call to bvhtree_from_mesh_*.
Definition at line 1690 of file bvhutils.c.
References BLI_bvhtree_free(), and data.
Referenced by BKE_bvhtree_from_editmesh_get(), and snap_object_data_editmesh_clear().
| void free_bvhtree_from_mesh | ( | struct BVHTreeFromMesh * | data | ) |
Definition at line 1701 of file bvhutils.c.
References BLI_bvhtree_free(), data, and MEM_freeN.
Referenced by blender::nodes::attribute_calc_proximity(), BKE_bvhtree_from_mesh_get(), BKE_mesh_remap_calc_edges_from_mesh(), BKE_mesh_remap_calc_loops_from_mesh(), BKE_mesh_remap_calc_polys_from_mesh(), BKE_mesh_remap_calc_verts_from_mesh(), BKE_mesh_remesh_reproject_paint_mask(), BKE_remesh_reproject_sculpt_face_sets(), BKE_remesh_reproject_vertex_paint(), BKE_shrinkwrap_free_tree(), cloth_build_springs(), deformVerts(), dynamicPaint_paintMesh(), followtrack_project_to_depth_object_if_needed(), freeData(), get_vert2geom_distance(), harmonic_coordinates_bind(), PE_free_shape_tree(), raycastMesh(), RE_bake_pixels_populate_from_objects(), remap_hair_emitter(), snap_object_data_mesh_clear(), snapMesh(), surfacedeformBind(), and weldModifier_doWeld().
| void free_bvhtree_from_pointcloud | ( | struct BVHTreeFromPointCloud * | data | ) |
Definition at line 1754 of file bvhutils.c.
References BLI_bvhtree_free(), and data.
Referenced by blender::nodes::attribute_calc_proximity().