diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-13 15:54:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-13 17:36:03 +0300 |
commit | a2a7260915633eda8a3d26aa678baba49b2429ce (patch) | |
tree | 41e042f052e8629a57d0b8d7a0153a420addb605 /source/blender/blenkernel/BKE_editmesh_bvh.h | |
parent | bd0077071521f212e8408638c6bf05b55a140eac (diff) |
BMesh: option to filter out faces during raycast
This allows us to more easily cast from the surface of a mesh
without normal offsets (Which can give precision issues).
Diffstat (limited to 'source/blender/blenkernel/BKE_editmesh_bvh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_editmesh_bvh.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_editmesh_bvh.h b/source/blender/blenkernel/BKE_editmesh_bvh.h index 168f700d132..3ee7dcd94b8 100644 --- a/source/blender/blenkernel/BKE_editmesh_bvh.h +++ b/source/blender/blenkernel/BKE_editmesh_bvh.h @@ -43,6 +43,8 @@ struct Scene; typedef struct BMBVHTree BMBVHTree; +typedef bool (*BMBVHTree_FaceFilter)(struct BMFace *f, void *userdata); + BMBVHTree *BKE_bmbvh_new_from_editmesh( struct BMEditMesh *em, int flag, const float (*cos_cage)[3], const bool cos_cage_free); @@ -55,8 +57,16 @@ BMBVHTree *BKE_bmbvh_new( const float (*cos_cage)[3], const bool cos_cage_free); void BKE_bmbvh_free(BMBVHTree *tree); struct BVHTree *BKE_bmbvh_tree_get(BMBVHTree *tree); -struct BMFace *BKE_bmbvh_ray_cast(BMBVHTree *tree, const float co[3], const float dir[3], const float radius, - float *r_dist, float r_hitout[3], float r_cagehit[3]); + +struct BMFace *BKE_bmbvh_ray_cast( + BMBVHTree *tree, const float co[3], const float dir[3], const float radius, + float *r_dist, float r_hitout[3], float r_cagehit[3]); + +struct BMFace *BKE_bmbvh_ray_cast_filter( + BMBVHTree *tree, const float co[3], const float dir[3], const float radius, + float *r_dist, float r_hitout[3], float r_cagehit[3], + BMBVHTree_FaceFilter filter, void *filter_cb); + /* find a face intersecting a segment (but not apart of the segment) */ struct BMFace *BKE_bmbvh_find_face_segment(BMBVHTree *tree, const float co_a[3], const float co_b[3], float *r_fac, float r_hitout[3], float r_cagehit[3]); |