Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_bvhutils.h
| Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
| * The tree is build in mesh space coordinates, this means special care must be made on queries | * 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. | * 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. | * 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. | * free_bvhtree_from_mesh should be called when the tree is no longer needed. | ||||
| */ | */ | ||||
| BVHTree *bvhtree_from_editmesh_verts( | BVHTree *bvhtree_from_editmesh_verts( | ||||
| BVHTreeFromEditMesh *data, struct BMEditMesh *em, | BVHTreeFromEditMesh *data, struct BMEditMesh *em, | ||||
| float epsilon, int tree_type, int axis); | float epsilon, int tree_type, int axis, BVHCache **bvhCache); | ||||
| BVHTree *bvhtree_from_editmesh_verts_ex( | BVHTree *bvhtree_from_editmesh_verts_ex( | ||||
| BVHTreeFromEditMesh *data, struct BMEditMesh *em, | BVHTreeFromEditMesh *data, struct BMEditMesh *em, | ||||
| const BLI_bitmap *mask, int verts_num_active, | const BLI_bitmap *mask, int verts_num_active, | ||||
| float epsilon, int tree_type, int axis); | float epsilon, int tree_type, int axis); | ||||
| BVHTree *bvhtree_from_mesh_verts_ex( | BVHTree *bvhtree_from_mesh_verts_ex( | ||||
| struct BVHTreeFromMesh *data, const struct MVert *vert, const int numVerts, | struct BVHTreeFromMesh *data, const struct MVert *vert, const int numVerts, | ||||
| const bool vert_allocated, const BLI_bitmap *mask, int verts_num_active, | const bool vert_allocated, const BLI_bitmap *mask, int verts_num_active, | ||||
| float epsilon, int tree_type, int axis); | float epsilon, int tree_type, int axis); | ||||
| BVHTree *bvhtree_from_editmesh_edges( | BVHTree *bvhtree_from_editmesh_edges( | ||||
| BVHTreeFromEditMesh *data, struct BMEditMesh *em, | BVHTreeFromEditMesh *data, struct BMEditMesh *em, | ||||
| float epsilon, int tree_type, int axis); | float epsilon, int tree_type, int axis, BVHCache **bvhCache); | ||||
| BVHTree *bvhtree_from_editmesh_edges_ex( | BVHTree *bvhtree_from_editmesh_edges_ex( | ||||
| BVHTreeFromEditMesh *data, struct BMEditMesh *em, | BVHTreeFromEditMesh *data, struct BMEditMesh *em, | ||||
| const BLI_bitmap *edges_mask, int edges_num_active, | const BLI_bitmap *edges_mask, int edges_num_active, | ||||
| float epsilon, int tree_type, int axis); | float epsilon, int tree_type, int axis); | ||||
| BVHTree *bvhtree_from_mesh_edges_ex( | BVHTree *bvhtree_from_mesh_edges_ex( | ||||
| struct BVHTreeFromMesh *data, | struct BVHTreeFromMesh *data, | ||||
| const struct MVert *vert, const bool vert_allocated, | const struct MVert *vert, const bool vert_allocated, | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | enum { | ||||
| BVHTREE_FROM_VERTS = 0, | BVHTREE_FROM_VERTS = 0, | ||||
| BVHTREE_FROM_EDGES = 1, | BVHTREE_FROM_EDGES = 1, | ||||
| BVHTREE_FROM_FACES = 2, | BVHTREE_FROM_FACES = 2, | ||||
| BVHTREE_FROM_LOOPTRI = 3, | BVHTREE_FROM_LOOPTRI = 3, | ||||
| BVHTREE_FROM_LOOSEVERTS = 4, | BVHTREE_FROM_LOOSEVERTS = 4, | ||||
| BVHTREE_FROM_LOOSEEDGES = 5, | BVHTREE_FROM_LOOSEEDGES = 5, | ||||
| BVHTREE_FROM_EM_LOOPTRI = 6, | BVHTREE_FROM_EM_VERTS = 6, | ||||
| BVHTREE_FROM_EM_EDGES = 7, | |||||
| BVHTREE_FROM_EM_LOOPTRI = 8, | |||||
| }; | }; | ||||
| bool bvhcache_find(const BVHCache *cache, int type, BVHTree **r_tree); | bool bvhcache_find(const BVHCache *cache, int type, BVHTree **r_tree); | ||||
| bool bvhcache_has_tree(const BVHCache *cache, const BVHTree *tree); | bool bvhcache_has_tree(const BVHCache *cache, const BVHTree *tree); | ||||
| void bvhcache_insert(BVHCache **cache_p, BVHTree *tree, int type); | void bvhcache_insert(BVHCache **cache_p, BVHTree *tree, int type); | ||||
| void bvhcache_free(BVHCache **cache_p); | void bvhcache_free(BVHCache **cache_p); | ||||
| #endif | #endif | ||||