diff options
author | Germano <germano.costa@ig.com.br> | 2018-05-14 22:00:13 +0300 |
---|---|---|
committer | Germano <germano.costa@ig.com.br> | 2018-05-14 22:01:36 +0300 |
commit | 8cbf402eb61bde42c63963eb092bf6722516280b (patch) | |
tree | 680408e89e357be265f7e7f2f06bd288b28ef0a2 /source/blender/blenlib/BLI_kdopbvh.h | |
parent | 70a60061e59fde7bb0e9cf9585365238b8c1d58f (diff) |
New function for BLI_kdopbvh: `BLI_bvhtree_find_nearest_projected`.
This patch does not make any difference for a user's POV. But it is a step for adding the occlusion test for snapping functions.
This new function finds the node(aabb) whose projection is closest to a screen coordinate.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3180
Diffstat (limited to 'source/blender/blenlib/BLI_kdopbvh.h')
-rw-r--r-- | source/blender/blenlib/BLI_kdopbvh.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index c92f40c67bf..cef525d0592 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -101,6 +101,11 @@ typedef bool (*BVHTree_OverlapCallback)(void *userdata, int index_a, int index_b /* callback to range search query */ typedef void (*BVHTree_RangeQuery)(void *userdata, int index, const float co[3], float dist_sq); +/* callback to find nearest projected */ +typedef void (*BVHTree_NearestProjectedCallback)(void *userdata, int index, + struct DistProjectedAABBPrecalc *precalc, + BVHTreeNearest *nearest); + /* callbacks to BLI_bvhtree_walk_dfs */ /* return true to traverse into this nodes children, else skip. */ @@ -162,6 +167,12 @@ int BLI_bvhtree_range_query( BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata); +int BLI_bvhtree_find_nearest_projected( + BVHTree *tree, float projmat[4][4], float winsize[2], float mval[2], + float clip_planes[6][4], int clip_num, + BVHTreeNearest *nearest, + BVHTree_NearestProjectedCallback callback, void *userdata); + void BLI_bvhtree_walk_dfs( BVHTree *tree, BVHTree_WalkParentCallback walk_parent_cb, |