Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/BLI_kdopbvh.c
| Show First 20 Lines • Show All 2,034 Lines • ▼ Show 20 Lines | |||||
| /** \name BLI_bvhtree_nearest_projected | /** \name BLI_bvhtree_nearest_projected | ||||
| * \{ */ | * \{ */ | ||||
| static void bvhtree_nearest_projected_dfs_recursive( | static void bvhtree_nearest_projected_dfs_recursive( | ||||
| BVHNearestProjectedData *__restrict data, const BVHNode *node) | BVHNearestProjectedData *__restrict data, const BVHNode *node) | ||||
| { | { | ||||
| if (node->totnode == 0) { | if (node->totnode == 0) { | ||||
| if (data->callback) { | if (data->callback) { | ||||
| data->callback(data->userdata, node->index, &data->precalc, &data->nearest); | data->callback( | ||||
| data->userdata, node->index, &data->precalc, | |||||
| NULL, 0, | |||||
| &data->nearest); | |||||
| } | } | ||||
| else { | else { | ||||
| data->nearest.index = node->index; | data->nearest.index = node->index; | ||||
| data->nearest.dist_sq = dist_squared_to_projected_aabb( | data->nearest.dist_sq = dist_squared_to_projected_aabb( | ||||
| &data->precalc, | &data->precalc, | ||||
| (float[3]) {node->bv[0], node->bv[2], node->bv[4]}, | (float[3]) {node->bv[0], node->bv[2], node->bv[4]}, | ||||
| (float[3]) {node->bv[1], node->bv[3], node->bv[5]}, | (float[3]) {node->bv[1], node->bv[3], node->bv[5]}, | ||||
| data->closest_axis); | data->closest_axis); | ||||
| Show All 32 Lines | static void bvhtree_nearest_projected_dfs_recursive( | ||||
| } | } | ||||
| } | } | ||||
| static void bvhtree_nearest_projected_with_clipplane_test_dfs_recursive( | static void bvhtree_nearest_projected_with_clipplane_test_dfs_recursive( | ||||
| BVHNearestProjectedData *__restrict data, const BVHNode *node) | BVHNearestProjectedData *__restrict data, const BVHNode *node) | ||||
| { | { | ||||
| if (node->totnode == 0) { | if (node->totnode == 0) { | ||||
| if (data->callback) { | if (data->callback) { | ||||
| data->callback(data->userdata, node->index, &data->precalc, &data->nearest); | data->callback( | ||||
| data->userdata, node->index, &data->precalc, | |||||
| data->clip_plane, data->clip_plane_len, | |||||
| &data->nearest); | |||||
| } | } | ||||
| else { | else { | ||||
| data->nearest.index = node->index; | data->nearest.index = node->index; | ||||
| data->nearest.dist_sq = dist_squared_to_projected_aabb( | data->nearest.dist_sq = dist_squared_to_projected_aabb( | ||||
| &data->precalc, | &data->precalc, | ||||
| (float[3]) {node->bv[0], node->bv[2], node->bv[4]}, | (float[3]) {node->bv[0], node->bv[2], node->bv[4]}, | ||||
| (float[3]) {node->bv[1], node->bv[3], node->bv[5]}, | (float[3]) {node->bv[1], node->bv[3], node->bv[5]}, | ||||
| data->closest_axis); | data->closest_axis); | ||||
| ▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines | |||||