Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/bvhutils.c
| Show First 20 Lines • Show All 711 Lines • ▼ Show 20 Lines | if (in_cache == false) { | ||||
| tree = bvhtree_from_mesh_verts_create_tree( | tree = bvhtree_from_mesh_verts_create_tree( | ||||
| epsilon, tree_type, axis, vert, verts_num, verts_mask, verts_num_active); | epsilon, tree_type, axis, vert, verts_num, verts_mask, verts_num_active); | ||||
| if (bvh_cache_p) { | if (bvh_cache_p) { | ||||
| /* Save on cache for later use */ | /* Save on cache for later use */ | ||||
| /* printf("BVHTree built and saved on cache\n"); */ | /* printf("BVHTree built and saved on cache\n"); */ | ||||
| BVHCache *bvh_cache = *bvh_cache_p; | BVHCache *bvh_cache = *bvh_cache_p; | ||||
| bvhcache_insert(bvh_cache, tree, bvh_cache_type); | bvhcache_insert(bvh_cache, tree, bvh_cache_type); | ||||
| bvhcache_unlock(bvh_cache, lock_started); | |||||
| in_cache = true; | in_cache = true; | ||||
| } | } | ||||
| } | } | ||||
| if (bvh_cache_p) { | |||||
| bvhcache_unlock(*bvh_cache_p, lock_started); | |||||
| } | |||||
| /* Setup BVHTreeFromMesh */ | /* Setup BVHTreeFromMesh */ | ||||
| bvhtree_from_mesh_verts_setup_data(data, tree, in_cache, vert, vert_allocated); | bvhtree_from_mesh_verts_setup_data(data, tree, in_cache, vert, vert_allocated); | ||||
| return tree; | return tree; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | if (in_cache == false) { | ||||
| tree = bvhtree_from_mesh_edges_create_tree( | tree = bvhtree_from_mesh_edges_create_tree( | ||||
| vert, edge, edges_num, edges_mask, edges_num_active, epsilon, tree_type, axis); | vert, edge, edges_num, edges_mask, edges_num_active, epsilon, tree_type, axis); | ||||
| if (bvh_cache_p) { | if (bvh_cache_p) { | ||||
| BVHCache *bvh_cache = *bvh_cache_p; | BVHCache *bvh_cache = *bvh_cache_p; | ||||
| /* Save on cache for later use */ | /* Save on cache for later use */ | ||||
| /* printf("BVHTree built and saved on cache\n"); */ | /* printf("BVHTree built and saved on cache\n"); */ | ||||
| bvhcache_insert(bvh_cache, tree, bvh_cache_type); | bvhcache_insert(bvh_cache, tree, bvh_cache_type); | ||||
| bvhcache_unlock(bvh_cache, lock_started); | |||||
| in_cache = true; | in_cache = true; | ||||
| } | } | ||||
| } | } | ||||
| if (bvh_cache_p) { | |||||
| bvhcache_unlock(*bvh_cache_p, lock_started); | |||||
| } | |||||
| /* Setup BVHTreeFromMesh */ | /* Setup BVHTreeFromMesh */ | ||||
| bvhtree_from_mesh_edges_setup_data( | bvhtree_from_mesh_edges_setup_data( | ||||
| data, tree, in_cache, vert, vert_allocated, edge, edge_allocated); | data, tree, in_cache, vert, vert_allocated, edge, edge_allocated); | ||||
| return tree; | return tree; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | if (in_cache == false) { | ||||
| tree = bvhtree_from_mesh_faces_create_tree( | tree = bvhtree_from_mesh_faces_create_tree( | ||||
| epsilon, tree_type, axis, vert, face, numFaces, faces_mask, faces_num_active); | epsilon, tree_type, axis, vert, face, numFaces, faces_mask, faces_num_active); | ||||
| if (bvh_cache_p) { | if (bvh_cache_p) { | ||||
| /* Save on cache for later use */ | /* Save on cache for later use */ | ||||
| /* printf("BVHTree built and saved on cache\n"); */ | /* printf("BVHTree built and saved on cache\n"); */ | ||||
| BVHCache *bvh_cache = *bvh_cache_p; | BVHCache *bvh_cache = *bvh_cache_p; | ||||
| bvhcache_insert(bvh_cache, tree, bvh_cache_type); | bvhcache_insert(bvh_cache, tree, bvh_cache_type); | ||||
| bvhcache_unlock(bvh_cache, lock_started); | |||||
| in_cache = true; | in_cache = true; | ||||
| } | } | ||||
| } | } | ||||
| if (bvh_cache_p) { | |||||
| bvhcache_unlock(*bvh_cache_p, lock_started); | |||||
| } | |||||
| /* Setup BVHTreeFromMesh */ | /* Setup BVHTreeFromMesh */ | ||||
| bvhtree_from_mesh_faces_setup_data( | bvhtree_from_mesh_faces_setup_data( | ||||
| data, tree, in_cache, vert, vert_allocated, face, face_allocated); | data, tree, in_cache, vert, vert_allocated, face, face_allocated); | ||||
| return tree; | return tree; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | tree = bvhtree_from_mesh_looptri_create_tree(epsilon, | ||||
| looptri, | looptri, | ||||
| looptri_num, | looptri_num, | ||||
| looptri_mask, | looptri_mask, | ||||
| looptri_num_active); | looptri_num_active); | ||||
| if (bvh_cache_p) { | if (bvh_cache_p) { | ||||
| BVHCache *bvh_cache = *bvh_cache_p; | BVHCache *bvh_cache = *bvh_cache_p; | ||||
| bvhcache_insert(bvh_cache, tree, bvh_cache_type); | bvhcache_insert(bvh_cache, tree, bvh_cache_type); | ||||
| bvhcache_unlock(bvh_cache, lock_started); | |||||
| in_cache = true; | in_cache = true; | ||||
| } | } | ||||
| } | } | ||||
| if (bvh_cache_p) { | |||||
| bvhcache_unlock(*bvh_cache_p, lock_started); | |||||
| } | |||||
| /* Setup BVHTreeFromMesh */ | /* Setup BVHTreeFromMesh */ | ||||
| bvhtree_from_mesh_looptri_setup_data(data, | bvhtree_from_mesh_looptri_setup_data(data, | ||||
| tree, | tree, | ||||
| in_cache, | in_cache, | ||||
| vert, | vert, | ||||
| vert_allocated, | vert_allocated, | ||||
| mloop, | mloop, | ||||
| loop_allocated, | loop_allocated, | ||||
| ▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines | |||||