Blender  V3.3
Classes | Functions
editmesh_bvh.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_kdopbvh.h"
#include "BLI_math.h"
#include "BKE_editmesh.h"
#include "BKE_editmesh_bvh.h"

Go to the source code of this file.

Classes

struct  BMBVHTree
 
struct  RayCastUserData
 
struct  RayCastUserData_Filter
 
struct  VertSearchUserData
 
struct  FaceSearchUserData
 
struct  BMBVHTree_OverlapData
 

Functions

BMBVHTreeBKE_bmbvh_new_from_editmesh (BMEditMesh *em, int flag, const float(*cos_cage)[3], const bool cos_cage_free)
 
BMBVHTreeBKE_bmbvh_new_ex (BMesh *bm, BMLoop *(*looptris)[3], int looptris_tot, int flag, const float(*cos_cage)[3], const bool cos_cage_free, bool(*test_fn)(BMFace *, void *user_data), void *user_data)
 
static bool bm_face_is_select (BMFace *f, void *UNUSED(user_data))
 
static bool bm_face_is_not_hidden (BMFace *f, void *UNUSED(user_data))
 
BMBVHTreeBKE_bmbvh_new (BMesh *bm, BMLoop *(*looptris)[3], int looptris_tot, int flag, const float(*cos_cage)[3], const bool cos_cage_free)
 
void BKE_bmbvh_free (BMBVHTree *bmtree)
 
BVHTreeBKE_bmbvh_tree_get (BMBVHTree *bmtree)
 
static void bmbvh_tri_from_face (const float *cos[3], const BMLoop **ltri, const float(*cos_cage)[3])
 
static BMFacebmbvh_ray_cast_handle_hit (BMBVHTree *bmtree, struct RayCastUserData *bmcb_data, const BVHTreeRayHit *hit, float *r_dist, float r_hitout[3], float r_cagehit[3])
 
static void bmbvh_ray_cast_cb (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
 
BMFaceBKE_bmbvh_ray_cast (BMBVHTree *bmtree, const float co[3], const float dir[3], const float radius, float *r_dist, float r_hitout[3], float r_cagehit[3])
 
static void bmbvh_ray_cast_cb_filter (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
 
BMFaceBKE_bmbvh_ray_cast_filter (BMBVHTree *bmtree, 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_cb, void *filter_userdata)
 
static void bmbvh_find_vert_closest_cb (void *userdata, int index, const float co[3], BVHTreeNearest *hit)
 
BMVertBKE_bmbvh_find_vert_closest (BMBVHTree *bmtree, const float co[3], const float dist_max)
 
static void bmbvh_find_face_closest_cb (void *userdata, int index, const float co[3], BVHTreeNearest *hit)
 
struct BMFaceBKE_bmbvh_find_face_closest (BMBVHTree *bmtree, const float co[3], const float dist_max)
 
static bool bmbvh_overlap_cb (void *userdata, int index_a, int index_b, int UNUSED(thread))
 
BVHTreeOverlapBKE_bmbvh_overlap (const BMBVHTree *bmtree_a, const BMBVHTree *bmtree_b, unsigned int *r_overlap_tot)
 
static bool bmbvh_overlap_self_cb (void *userdata, int index_a, int index_b, int thread)
 
BVHTreeOverlapBKE_bmbvh_overlap_self (const BMBVHTree *bmtree, unsigned int *r_overlap_tot)
 

Function Documentation

◆ BKE_bmbvh_find_face_closest()

struct BMFace* BKE_bmbvh_find_face_closest ( BMBVHTree bmtree,
const float  co[3],
const float  dist_max 
)

◆ BKE_bmbvh_find_vert_closest()

BMVert* BKE_bmbvh_find_vert_closest ( BMBVHTree tree,
const float  co[3],
float  dist_max 
)

◆ BKE_bmbvh_free()

void BKE_bmbvh_free ( BMBVHTree bmtree)

◆ BKE_bmbvh_new()

BMBVHTree* BKE_bmbvh_new ( BMesh bm,
BMLoop *(*)  looptris[3],
int  looptris_tot,
int  flag,
const float(*)  cos_cage[3],
const bool  cos_cage_free 
)

◆ BKE_bmbvh_new_ex()

BMBVHTree* BKE_bmbvh_new_ex ( BMesh bm,
BMLoop *(*)  looptris[3],
int  looptris_tot,
int  flag,
const float(*)  cos_cage[3],
const bool  cos_cage_free,
bool(*)(BMFace *, void *user_data test_fn,
void user_data 
)

◆ BKE_bmbvh_new_from_editmesh()

BMBVHTree* BKE_bmbvh_new_from_editmesh ( BMEditMesh em,
int  flag,
const float(*)  cos_cage[3],
const bool  cos_cage_free 
)

◆ BKE_bmbvh_overlap()

BVHTreeOverlap* BKE_bmbvh_overlap ( const BMBVHTree bmtree_a,
const BMBVHTree bmtree_b,
unsigned int *  r_overlap_tot 
)

Overlap indices reference the looptri's.

Definition at line 552 of file editmesh_bvh.c.

References BLI_bvhtree_get_epsilon(), BLI_bvhtree_overlap(), bmbvh_overlap_cb(), data, max_ff(), and BMBVHTree::tree.

◆ BKE_bmbvh_overlap_self()

BVHTreeOverlap* BKE_bmbvh_overlap_self ( const BMBVHTree bmtree,
unsigned int *  r_overlap_tot 
)

Overlap indices reference the looptri's.

Definition at line 575 of file editmesh_bvh.c.

References BLI_bvhtree_get_epsilon(), BLI_bvhtree_overlap(), bmbvh_overlap_self_cb(), data, and BMBVHTree::tree.

Referenced by blender::draw::statvis_calc_intersect().

◆ BKE_bmbvh_ray_cast()

BMFace* BKE_bmbvh_ray_cast ( BMBVHTree bmtree,
const float  co[3],
const float  dir[3],
const float  radius,
float r_dist,
float  r_hitout[3],
float  r_cagehit[3] 
)

◆ BKE_bmbvh_ray_cast_filter()

BMFace* BKE_bmbvh_ray_cast_filter ( BMBVHTree bmtree,
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_cb,
void filter_userdata 
)

◆ BKE_bmbvh_tree_get()

BVHTree* BKE_bmbvh_tree_get ( BMBVHTree bmtree)

Definition at line 181 of file editmesh_bvh.c.

References BMBVHTree::tree.

◆ bm_face_is_not_hidden()

static bool bm_face_is_not_hidden ( BMFace f,
void UNUSEDuser_data 
)
static

Definition at line 140 of file editmesh_bvh.c.

References BM_elem_flag_test, and BM_ELEM_HIDDEN.

Referenced by BKE_bmbvh_new().

◆ bm_face_is_select()

static bool bm_face_is_select ( BMFace f,
void UNUSEDuser_data 
)
static

Definition at line 135 of file editmesh_bvh.c.

References BM_elem_flag_test, and BM_ELEM_SELECT.

Referenced by BKE_bmbvh_new().

◆ bmbvh_find_face_closest_cb()

static void bmbvh_find_face_closest_cb ( void userdata,
int  index,
const float  co[3],
BVHTreeNearest hit 
)
static

◆ bmbvh_find_vert_closest_cb()

static void bmbvh_find_vert_closest_cb ( void userdata,
int  index,
const float  co[3],
BVHTreeNearest hit 
)
static

◆ bmbvh_overlap_cb()

static bool bmbvh_overlap_cb ( void userdata,
int  index_a,
int  index_b,
int   UNUSEDthread 
)
static

◆ bmbvh_overlap_self_cb()

static bool bmbvh_overlap_self_cb ( void userdata,
int  index_a,
int  index_b,
int  thread 
)
static

Definition at line 567 of file editmesh_bvh.c.

References bmbvh_overlap_cb().

Referenced by BKE_bmbvh_overlap_self().

◆ bmbvh_ray_cast_cb()

static void bmbvh_ray_cast_cb ( void userdata,
int  index,
const BVHTreeRay ray,
BVHTreeRayHit hit 
)
static

◆ bmbvh_ray_cast_cb_filter()

static void bmbvh_ray_cast_cb_filter ( void userdata,
int  index,
const BVHTreeRay ray,
BVHTreeRayHit hit 
)
static

◆ bmbvh_ray_cast_handle_hit()

static BMFace* bmbvh_ray_cast_handle_hit ( BMBVHTree bmtree,
struct RayCastUserData bmcb_data,
const BVHTreeRayHit hit,
float r_dist,
float  r_hitout[3],
float  r_cagehit[3] 
)
static

◆ bmbvh_tri_from_face()

static void bmbvh_tri_from_face ( const float cos[3],
const BMLoop **  ltri,
const float(*)  cos_cage[3] 
)
static

Return the coords from a triangle.

Definition at line 192 of file editmesh_bvh.c.

References BM_elem_index_get, BMVert::co, KDL::cos(), NULL, BMLoop::v, and v.

Referenced by bmbvh_find_face_closest_cb(), bmbvh_find_vert_closest_cb(), and bmbvh_ray_cast_cb().