Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/bvhutils.c
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_bvhutils.h" | #include "BKE_bvhutils.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_mesh_runtime.h" | #include "BKE_mesh_runtime.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "CLG_log.h" | |||||
| static CLG_LogRef LOG = {"bke.bvhutils"}; | |||||
| static ThreadRWMutex cache_rwlock = BLI_RWLOCK_INITIALIZER; | static ThreadRWMutex cache_rwlock = BLI_RWLOCK_INITIALIZER; | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Local Callbacks | /** \name Local Callbacks | ||||
| * \{ */ | * \{ */ | ||||
| /* Math stuff for ray casting on mesh faces and for nearest surface */ | /* Math stuff for ray casting on mesh faces and for nearest surface */ | ||||
| ▲ Show 20 Lines • Show All 1,184 Lines • ▼ Show 20 Lines | switch (type) { | ||||
| case BVHTREE_FROM_EM_LOOPTRI: | case BVHTREE_FROM_EM_LOOPTRI: | ||||
| BLI_assert(false); | BLI_assert(false); | ||||
| break; | break; | ||||
| } | } | ||||
| if (data_cp.tree != NULL) { | if (data_cp.tree != NULL) { | ||||
| #ifdef DEBUG | #ifdef DEBUG | ||||
| if (BLI_bvhtree_get_tree_type(data_cp.tree) != tree_type) { | if (BLI_bvhtree_get_tree_type(data_cp.tree) != tree_type) { | ||||
| printf("tree_type %d obtained instead of %d\n", | CLOG_WARN(&LOG, "tree_type %d obtained instead of %d", | ||||
| BLI_bvhtree_get_tree_type(data_cp.tree), tree_type); | BLI_bvhtree_get_tree_type(data_cp.tree), tree_type); | ||||
| } | } | ||||
| #endif | #endif | ||||
| data_cp.cached = true; | data_cp.cached = true; | ||||
| memcpy(data, &data_cp, sizeof(*data)); | memcpy(data, &data_cp, sizeof(*data)); | ||||
| } | } | ||||
| else { | else { | ||||
| free_bvhtree_from_mesh(&data_cp); | free_bvhtree_from_mesh(&data_cp); | ||||
| memset(data, 0, sizeof(*data)); | memset(data, 0, sizeof(*data)); | ||||
| ▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines | |||||