Blender  V3.3
BKE_editmesh_bvh.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct BMBVHTree;
15 struct BMEditMesh;
16 struct BMFace;
17 struct BMLoop;
18 struct BMVert;
19 struct BMesh;
20 struct BVHTree;
21 
22 typedef struct BMBVHTree BMBVHTree;
23 
24 typedef bool (*BMBVHTree_FaceFilter)(struct BMFace *f, void *userdata);
25 
27  int flag,
28  const float (*cos_cage)[3],
29  bool cos_cage_free);
31  struct BMLoop *(*looptris)[3],
32  int looptris_tot,
33  int flag,
34  const float (*cos_cage)[3],
35  bool cos_cage_free,
36  bool (*test_fn)(struct BMFace *, void *user_data),
37  void *user_data);
39  struct BMLoop *(*looptris)[3],
40  int looptris_tot,
41  int flag,
42  const float (*cos_cage)[3],
43  bool cos_cage_free);
46 
48  const float co[3],
49  const float dir[3],
50  float radius,
51  float *r_dist,
52  float r_hitout[3],
53  float r_cagehit[3]);
54 
56  const float co[3],
57  const float dir[3],
58  float radius,
59  float *r_dist,
60  float r_hitout[3],
61  float r_cagehit[3],
62  BMBVHTree_FaceFilter filter_cb,
63  void *filter_userdata);
64 
68 struct BMVert *BKE_bmbvh_find_vert_closest(BMBVHTree *tree, const float co[3], float dist_max);
69 struct BMFace *BKE_bmbvh_find_face_closest(BMBVHTree *tree, const float co[3], float dist_max);
70 
74 struct BVHTreeOverlap *BKE_bmbvh_overlap(const BMBVHTree *bmtree_a,
75  const BMBVHTree *bmtree_b,
76  unsigned int *r_overlap_tot);
77 
81 struct BVHTreeOverlap *BKE_bmbvh_overlap_self(const BMBVHTree *bmtree,
82  unsigned int *r_overlap_tot);
83 
85 enum {
87  BMBVH_RETURN_ORIG = (1 << 0),
92 };
93 
94 #ifdef __cplusplus
95 }
96 #endif
struct BMFace * BKE_bmbvh_ray_cast(BMBVHTree *tree, const float co[3], const float dir[3], float radius, float *r_dist, float r_hitout[3], float r_cagehit[3])
Definition: editmesh_bvh.c:290
bool(* BMBVHTree_FaceFilter)(struct BMFace *f, void *userdata)
struct BVHTreeOverlap * BKE_bmbvh_overlap(const BMBVHTree *bmtree_a, const BMBVHTree *bmtree_b, unsigned int *r_overlap_tot)
Definition: editmesh_bvh.c:552
struct BMFace * BKE_bmbvh_find_face_closest(BMBVHTree *tree, const float co[3], float dist_max)
Definition: editmesh_bvh.c:484
struct BMFace * BKE_bmbvh_ray_cast_filter(BMBVHTree *tree, const float co[3], const float dir[3], float radius, float *r_dist, float r_hitout[3], float r_cagehit[3], BMBVHTree_FaceFilter filter_cb, void *filter_userdata)
Definition: editmesh_bvh.c:348
struct BVHTree * BKE_bmbvh_tree_get(BMBVHTree *tree)
Definition: editmesh_bvh.c:181
BMBVHTree * BKE_bmbvh_new(struct BMesh *bm, struct BMLoop *(*looptris)[3], int looptris_tot, int flag, const float(*cos_cage)[3], bool cos_cage_free)
Definition: editmesh_bvh.c:145
void BKE_bmbvh_free(BMBVHTree *tree)
Definition: editmesh_bvh.c:170
struct BMVert * BKE_bmbvh_find_vert_closest(BMBVHTree *tree, const float co[3], float dist_max)
Definition: editmesh_bvh.c:425
struct BVHTreeOverlap * BKE_bmbvh_overlap_self(const BMBVHTree *bmtree, unsigned int *r_overlap_tot)
Definition: editmesh_bvh.c:575
BMBVHTree * BKE_bmbvh_new_from_editmesh(struct BMEditMesh *em, int flag, const float(*cos_cage)[3], bool cos_cage_free)
Definition: editmesh_bvh.c:31
@ BMBVH_RETURN_ORIG
@ BMBVH_RESPECT_HIDDEN
@ BMBVH_RESPECT_SELECT
BMBVHTree * BKE_bmbvh_new_ex(struct BMesh *bm, struct BMLoop *(*looptris)[3], int looptris_tot, int flag, const float(*cos_cage)[3], bool cos_cage_free, bool(*test_fn)(struct BMFace *, void *user_data), void *user_data)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void * user_data
void * tree
float co[3]
Definition: bmesh_class.h:87