40 #define LEAF_LIMIT 10000
44 #define STACK_FIXED_DEPTH 100
71 for (
int i = 0; i < 3; i++) {
79 for (
int i = 0; i < 3; i++) {
89 for (
int i = 0; i < 3; i++) {
93 if (dim[0] > dim[1]) {
94 if (dim[0] > dim[2]) {
101 if (dim[1] > dim[2]) {
110 for (
int i = 0; i < 3; i++) {
164 for (; prim_bbc[prim_indices[i]].
bcentroid[axis] < mid; i++) {
167 for (; mid < prim_bbc[prim_indices[j]].
bcentroid[axis]; j--) {
175 SWAP(
int, prim_indices[i], prim_indices[j]);
240 PBVH *pbvh,
GHash *
map,
unsigned int *face_verts,
unsigned int *uniq_verts,
int vertex)
242 void *key, **value_p;
249 value_i = *uniq_verts;
253 value_i = ~(*face_verts);
266 bool has_visible =
false;
268 node->uniq_verts =
node->face_verts = 0;
269 const int totface =
node->totprim;
274 int(*face_vert_indices)[3] =
MEM_mallocN(
sizeof(
int[3]) * totface,
"bvh node face vert indices");
276 node->face_vert_indices = (
const int(*)[3])face_vert_indices;
282 for (
int i = 0; i < totface; i++) {
284 for (
int j = 0; j < 3; j++) {
289 if (has_visible ==
false) {
297 "bvh node vert indices");
298 node->vert_indices = vert_indices;
307 ndx = -ndx +
node->uniq_verts - 1;
313 for (
int i = 0; i < totface; i++) {
316 for (
int j = 0; j < sides; j++) {
317 if (face_vert_indices[i][j] < 0) {
318 face_vert_indices[i][j] = -face_vert_indices[i][j] +
node->uniq_verts - 1;
340 const int *grid_indices,
344 const int gridarea = (gridsize - 1) * (gridsize - 1);
350 for (
int i = 0; i < totgrid; i++) {
351 const BLI_bitmap *gh = grid_hidden[grid_indices[i]];
355 for (
int y = 0;
y < gridsize - 1;
y++) {
356 for (
int x = 0;
x < gridsize - 1;
x++) {
374 for (
int i = 0; i < pbvh->
totgrid; i++) {
377 if (!gh && pbvh->
face_sets[face_index] < 0) {
379 "partialvis_update_grids");
382 for (
int y = 0;
y < gridsize;
y++) {
383 for (
int x = 0;
x < gridsize;
x++) {
469 if (below_leaf_limit) {
483 if (!below_leaf_limit) {
499 (cb->
bmax[axis] + cb->
bmin[axis]) * 0.5f,
519 if (totprim != pbvh->
totprim) {
528 for (
int i = 0; i < totprim; i++) {
539 build_sub(pbvh, 0, cb, prim_bbc, 0, totprim);
580 for (
int i = 0; i < looptri_num; i++) {
583 BBC *bbc = prim_bbc + i;
587 for (
int j = 0; j < sides; j++) {
603 memset(pbvh->
vert_bitmap, 0,
sizeof(
bool) * totvert);
633 for (
int i = 0; i < totgrid; i++) {
635 BBC *bbc = prim_bbc + i;
639 for (
int j = 0; j < gridsize * gridsize; j++) {
665 for (
int i = 0; i < pbvh->
totnode; i++) {
669 if (
node->draw_buffers) {
672 if (
node->vert_indices) {
675 if (
node->loop_indices) {
678 if (
node->face_vert_indices) {
681 if (
node->bm_faces) {
684 if (
node->bm_unique_verts) {
687 if (
node->bm_other_verts) {
843 int tot = 0, space = 0;
851 space = (tot == 0) ? 32 : space * 2;
862 if (tot == 0 &&
array) {
905 tree->left = new_node;
913 tree->right = new_node;
927 hcb(
tree->data, hit_data, tmin);
987 float tmin = FLT_MAX;
998 return (
node->flag & flag) != 0;
1025 const int totvert =
node->uniq_verts;
1026 for (
int i = 0; i < totvert; i++) {
1046 unsigned int mpoly_prev =
UINT_MAX;
1050 const int totface =
node->totprim;
1052 for (
int i = 0; i < totface; i++) {
1054 const unsigned int vtri[3] = {
1059 const int sides = 3;
1062 if (lt->
poly != mpoly_prev) {
1065 mpoly_prev = lt->
poly;
1068 for (
int j = sides; j--;) {
1069 const int v = vtri[j];
1076 for (
int k = 3; k--;) {
1096 const int totvert =
node->uniq_verts;
1098 for (
int i = 0; i < totvert; i++) {
1150 bool has_unmasked =
false;
1151 bool has_masked =
true;
1157 has_unmasked =
true;
1166 has_unmasked =
true;
1233 const int flag =
data->flag;
1268 return update_flags;
1309 vdata = pbvh->
vdata;
1310 ldata = pbvh->
ldata;
1318 switch (pbvh->
type) {
1347 switch (pbvh->
type) {
1381 node->bm_unique_verts,
1382 node->bm_other_verts,
1391 if (
node->draw_buffers) {
1408 switch (pbvh->
type) {
1419 vdata = pbvh->
vdata;
1420 ldata = pbvh->
ldata;
1423 ldata = vdata =
NULL;
1436 for (
int i = 0; i < pbvh->
totnode; i++) {
1454 switch (pbvh->
type) {
1464 vdata = pbvh->
vdata;
1474 for (
int n = 0; n < totnode; n++) {
1501 for (
int i = 0; i < totnode; i++) {
1583 for (
int i = 0; i < totnode; i++) {
1600 const int *vert_indices;
1605 for (i = 0; i < totvert; i++) {
1606 MVert *
v = &mvert[vert_indices[i]];
1620 int *grid_indices, totgrid, i;
1626 for (i = 0; i < totgrid; i++) {
1627 int g = grid_indices[i],
x,
y;
1649 GSet *unique, *other;
1761 for (
uint i = 0; i <
node->totprim; i++) {
1777 *r_gridfaces =
NULL;
1793 *r_gridfaces =
faces;
1887 for (
int n = 0; n < pbvh->
totnode; n++) {
1975 const int **r_loop_indices,
1976 const MLoop **r_loops)
1980 if (r_loop_indices) {
1981 *r_loop_indices =
node->loop_indices;
1985 *r_loops = pbvh->
mloop;
1991 const int **r_vert_indices,
1994 if (r_vert_indices) {
1995 *r_vert_indices =
node->vert_indices;
1999 *r_verts = pbvh->
verts;
2007 switch (pbvh->
type) {
2014 *r_uniquevert = tot;
2019 *r_totvert =
node->uniq_verts +
node->face_verts;
2022 *r_uniquevert =
node->uniq_verts;
2031 *r_uniquevert = tot;
2039 int **r_grid_indices,
2045 switch (pbvh->
type) {
2047 if (r_grid_indices) {
2048 *r_grid_indices =
node->prim_indices;
2051 *r_totgrid =
node->totprim;
2060 *r_griddata = pbvh->
grids;
2065 if (r_grid_indices) {
2066 *r_grid_indices =
NULL;
2098 if (
node->proxy_count > 0) {
2100 *proxies =
node->proxies;
2103 *proxy_count =
node->proxy_count;
2117 int (**r_orco_tris)[3],
2118 int *r_orco_tris_num,
2119 float (**r_orco_coords)[3])
2121 *r_orco_tris =
node->bm_ortri;
2122 *r_orco_tris_num =
node->bm_tot_ortri;
2123 *r_orco_coords =
node->bm_orco;
2130 const int totvert =
node->uniq_verts +
node->face_verts;
2132 for (
int i = 0; i < totvert; i++) {
2153 const float *bb_min, *bb_max;
2157 bb_min =
node->orig_vb.bmin;
2158 bb_max =
node->orig_vb.bmax;
2162 bb_min =
node->vb.bmin;
2163 bb_max =
node->vb.bmax;
2172 const float ray_start[3],
2173 const float ray_normal[3],
2195 (depth_test < *depth)) ||
2197 (depth_test < *depth))) {
2198 *depth = depth_test;
2214 (depth_test < *depth))) {
2215 *depth = depth_test;
2225 const float ray_direction[3],
2232 const float *tri[3] = {v0,
v1,
v2};
2233 float dist_sq_best = FLT_MAX;
2234 for (
int i = 0, j = 2; i < 3; j = i++) {
2235 float point_test[3], depth_test = FLT_MAX;
2237 ray_origin, ray_direction, tri[i], tri[j], point_test, &depth_test);
2238 if (dist_sq_test < dist_sq_best || i == 0) {
2240 *r_depth = depth_test;
2241 dist_sq_best = dist_sq_test;
2244 return dist_sq_best;
2248 const float ray_normal[3],
2257 float co[3], depth_test;
2260 ray_start, ray_normal, t0, t1, t2, co, &depth_test)) < *dist_sq)) {
2261 *dist_sq = dist_sq_test;
2262 *depth = depth_test;
2264 ray_start, ray_normal, t0, t2, t3, co, &depth_test)) < *dist_sq)) {
2265 *dist_sq = dist_sq_test;
2266 *depth = depth_test;
2275 const float ray_normal[3],
2283 float co[3], depth_test;
2286 ray_start, ray_normal, t0, t1, t2, co, &depth_test)) < *dist_sq)) {
2287 *dist_sq = dist_sq_test;
2288 *depth = depth_test;
2298 const float ray_start[3],
2299 const float ray_normal[3],
2302 int *r_active_vertex_index,
2303 int *r_active_face_index,
2304 float *r_face_normal)
2309 int totface =
node->totprim;
2311 float nearest_vertex_co[3] = {0.0f};
2313 for (
int i = 0; i < totface; i++) {
2315 const int *face_verts =
node->face_vert_indices[i];
2324 co[0] = origco[face_verts[0]];
2325 co[1] = origco[face_verts[1]];
2326 co[2] = origco[face_verts[2]];
2330 co[0] = vert[mloop[lt->
tri[0]].
v].
co;
2331 co[1] = vert[mloop[lt->
tri[1]].
v].
co;
2332 co[2] = vert[mloop[lt->
tri[2]].
v].
co;
2338 if (r_face_normal) {
2342 if (r_active_vertex_index) {
2343 float location[3] = {0.0f};
2345 for (
int j = 0; j < 3; j++) {
2352 *r_active_vertex_index = mloop[lt->
tri[j]].
v;
2353 *r_active_face_index = lt->
poly;
2366 const float ray_start[3],
2367 const float ray_normal[3],
2370 int *r_active_vertex_index,
2371 int *r_active_grid_index,
2372 float *r_face_normal)
2374 const int totgrid =
node->totprim;
2377 float nearest_vertex_co[3] = {0.0};
2380 for (
int i = 0; i < totgrid; i++) {
2381 const int grid_index =
node->prim_indices[i];
2391 for (
int y = 0;
y < gridsize - 1;
y++) {
2392 for (
int x = 0;
x < gridsize - 1;
x++) {
2402 co[0] = origco[(
y + 1) * gridsize +
x];
2403 co[1] = origco[(
y + 1) * gridsize +
x + 1];
2404 co[2] = origco[
y * gridsize +
x + 1];
2405 co[3] = origco[
y * gridsize +
x];
2415 ray_start, isect_precalc, co[0], co[1], co[2], co[3], depth)) {
2418 if (r_face_normal) {
2422 if (r_active_vertex_index) {
2423 float location[3] = {0.0};
2426 const int x_it[4] = {0, 1, 1, 0};
2427 const int y_it[4] = {1, 1, 0, 0};
2429 for (
int j = 0; j < 4; j++) {
2437 *r_active_vertex_index = gridkey->
grid_area * grid_index +
2438 (
y + y_it[j]) * gridkey->
grid_size + (
x + x_it[j]);
2442 if (r_active_grid_index) {
2443 *r_active_grid_index = grid_index;
2450 origco += gridsize * gridsize;
2461 const float ray_start[3],
2462 const float ray_normal[3],
2465 int *active_vertex_index,
2466 int *active_face_grid_index,
2475 switch (pbvh->
type) {
2484 active_vertex_index,
2485 active_face_grid_index,
2496 active_vertex_index,
2497 active_face_grid_index,
2508 active_vertex_index,
2517 PBVH *pbvh,
bool original,
float ray_start[3],
float ray_end[3],
float ray_normal[3])
2520 float rootmin_start, rootmin_end;
2521 float bb_min_root[3], bb_max_root[3], bb_center[3], bb_diff[3];
2523 float ray_normal_inv[3];
2524 float offset = 1.0f + 1e-3f;
2525 const float offset_vec[3] = {1e-3f, 1e-3f, 1e-3f};
2573 const float *bb_min, *bb_max;
2577 bb_min =
node->orig_vb.bmin;
2578 bb_max =
node->orig_vb.bmax;
2582 bb_min =
node->vb.bmin;
2583 bb_max =
node->vb.bmax;
2586 float co_dummy[3], depth;
2590 return depth > 0.0f;
2596 const float ray_start[3],
2597 const float ray_normal[3],
2611 const float ray_start[3],
2612 const float ray_normal[3],
2619 int i, totface =
node->totprim;
2622 for (i = 0; i < totface; i++) {
2624 const int *face_verts =
node->face_vert_indices[i];
2634 origco[face_verts[0]],
2635 origco[face_verts[1]],
2636 origco[face_verts[2]],
2644 vert[mloop[lt->
tri[0]].
v].
co,
2645 vert[mloop[lt->
tri[1]].v].
co,
2646 vert[mloop[lt->
tri[2]].v].
co,
2658 const float ray_start[3],
2659 const float ray_normal[3],
2663 const int totgrid =
node->totprim;
2667 for (
int i = 0; i < totgrid; i++) {
2677 for (
int y = 0;
y < gridsize - 1;
y++) {
2678 for (
int x = 0;
x < gridsize - 1;
x++) {
2689 origco[
y * gridsize +
x],
2690 origco[
y * gridsize +
x + 1],
2691 origco[(
y + 1) * gridsize +
x + 1],
2692 origco[(
y + 1) * gridsize +
x],
2710 origco += gridsize * gridsize;
2721 const float ray_start[3],
2722 const float ray_normal[3],
2732 switch (pbvh->
type) {
2735 pbvh,
node, origco, ray_start, ray_normal, depth, dist_sq);
2739 pbvh,
node, origco, ray_start, ray_normal, depth, dist_sq);
2743 node, ray_start, ray_normal, depth, dist_sq, use_origco);
2762 const float bb_max[3],
2768 for (
int i = 0; i < frustum->
num_planes; i++) {
2769 float vmin[3], vmax[3];
2771 for (
int axis = 0; axis < 3; axis++) {
2772 if (planes[i][axis] < 0) {
2773 vmin[axis] = bb_min[axis];
2774 vmax[axis] = bb_max[axis];
2777 vmin[axis] = bb_max[axis];
2778 vmax[axis] = bb_min[axis];
2782 if (
dot_v3v3(planes[i], vmin) + planes[i][3] < 0) {
2785 if (
dot_v3v3(planes[i], vmax) + planes[i][3] <= 0) {
2795 const float *bb_min, *bb_max;
2797 bb_min =
node->vb.bmin;
2798 bb_max =
node->vb.bmax;
2805 const float *bb_min, *bb_max;
2807 bb_min =
node->vb.bmin;
2808 bb_max =
node->vb.bmax;
2833 if (num_faces > 0) {
2865 data->accum_update_flag |=
node->flag;
2870 bool update_only_visible,
2875 bool UNUSED(full_render))
2879 int update_flag = 0;
2884 if (update_only_visible) {
2888 update_flag =
data.accum_update_flag;
2910 for (
int i = 0; i < totnode; i++) {
2935 pbvh->
grids = grids;
2956 float *co = (
float *)vertCos;
2958 for (
int a = 0;
a < pbvh->
totvert;
a++, mvert++, co += 3) {
2968 if (totvert != pbvh->
totvert) {
2969 BLI_assert_msg(0,
"PBVH: Given deforming vcos number does not match PBVH vertex number!");
2990 for (
int a = 0;
a < pbvh->
totvert;
a++, mvert++) {
2992 if (memcmp(mvert->
co, vertCos[
a],
sizeof(
float[3])) != 0) {
3018 int index, totverts;
3020 index =
node->proxy_count;
3022 node->proxy_count++;
3024 if (
node->proxies) {
3032 node->proxies[index].co =
MEM_callocN(
sizeof(
float[3]) * totverts,
"PBVHNodeProxy.co");
3034 return node->proxies + index;
3039 for (
int p = 0; p <
node->proxy_count; p++) {
3047 node->proxy_count = 0;
3053 int tot = 0, space = 0;
3055 for (
int n = 0; n < pbvh->
totnode; n++) {
3058 if (
node->proxy_count > 0) {
3061 space = (tot == 0) ? 32 : space * 2;
3070 if (tot == 0 &&
array) {
3082 if (!
node->color_buffer.color) {
3083 node->color_buffer.color =
MEM_callocN(
sizeof(
float[4]) *
node->uniq_verts,
"Color buffer");
3085 return &
node->color_buffer;
3093 for (
int i = 0; i < totnode; i++) {
3103 const int *vert_indices;
3105 int totgrid, gridsize, uniq_verts, totvert;
3125 vi->
totgrid = (grids) ? totgrid : 1;
3159 switch (pbvh->
type) {
3173 switch (pbvh->
type) {
3206 for (
int i = 0; i < planes->
num_planes; i++) {
3215 memset(settings, 0,
sizeof(*settings));
3266 *r_totloop =
node->loop_indices_num;
3287 for (
int i = 0; i < pbvh->
totnode; i++) {
3294 if (
node->loop_indices) {
3298 totloop +=
node->totprim * 3;
3304 for (
int i = 0; i < pbvh->
totnode; i++) {
3312 node->loop_indices_num = 0;
3314 for (
int j = 0; j <
node->totprim; j++) {
3317 for (
int k = 0; k < 3; k++) {
3319 node->loop_indices[
node->loop_indices_num++] = mlt->
tri[k];
typedef float(TangentPoint)[2]
Generic geometry attributes built on CustomData.
struct CustomDataLayer * BKE_id_attributes_active_color_get(const struct ID *id)
eAttrDomain BKE_id_attribute_domain(const struct ID *id, const struct CustomDataLayer *layer)
BLI_INLINE float * CCG_grid_elem_co(const CCGKey *key, CCGElem *elem, int x, int y)
BLI_INLINE float * CCG_elem_offset_co(const CCGKey *key, CCGElem *elem, int offset)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_get_offset(const struct CustomData *data, int type)
float(* BKE_mesh_vertex_normals_for_write(struct Mesh *mesh))[3]
const float(* BKE_mesh_vertex_normals_ensure(const struct Mesh *mesh))[3]
void BKE_mesh_calc_normals_looptri(struct MVert *mverts, int numVerts, const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num, float(*r_tri_nors)[3])
void BKE_mesh_calc_poly_normal(const struct MPoly *mpoly, const struct MLoop *loopstart, const struct MVert *mvarray, float r_no[3])
bool paint_is_face_hidden(const struct MLoopTri *lt, const struct MVert *mvert, const struct MLoop *mloop)
bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, int x, int y)
A BVH for high poly meshes.
#define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode)
void(* BKE_pbvh_HitCallback)(PBVHNode *node, void *data)
#define BKE_pbvh_vertex_iter_end
struct GSet * BKE_pbvh_bmesh_node_other_verts(PBVHNode *node)
void(* BKE_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float *tmin)
struct GSet * BKE_pbvh_bmesh_node_unique_verts(PBVHNode *node)
void(* BKE_pbvh_SearchNearestCallback)(PBVHNode *node, void *data, float *tmin)
@ PBVH_RebuildDrawBuffers
bool(* BKE_pbvh_SearchCallback)(PBVHNode *node, void *data)
void BKE_subdiv_ccg_update_normals(SubdivCCG *subdiv_ccg, struct CCGFace **effected_faces, int num_effected_faces)
int BKE_subdiv_ccg_grid_to_face_index(const SubdivCCG *subdiv_ccg, int grid_index)
#define BLI_assert_msg(a, msg)
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define BLI_BITMAP_SET(_bitmap, _index, _set)
#define GSET_ITER_INDEX(gs_iter_, gset_, i_)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
GHash * BLI_ghash_int_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
GSet * BLI_gset_ptr_new(const char *info)
unsigned int BLI_gset_len(const GSet *gs) ATTR_WARN_UNUSED_RESULT
#define GSET_ITER(gs_iter_, gset_)
BLI_INLINE void BLI_gsetIterator_init(GSetIterator *gsi, GSet *gs)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
BLI_INLINE void * BLI_gsetIterator_getKey(GSetIterator *gsi)
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
bool BLI_gset_add(GSet *gs, void *key)
void BLI_kdtree_nd_() free(KDTree *tree)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
float normal_quad_v3(float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
bool isect_ray_aabb_v3(const struct IsectRayAABB_Precalc *data, const float bb_min[3], const float bb_max[3], float *tmin)
void dist_squared_ray_to_aabb_v3_precalc(struct DistRayAABB_Precalc *neasrest_precalc, const float ray_origin[3], const float ray_direction[3])
bool isect_ray_tri_watertight_v3(const float ray_origin[3], const struct IsectRayPrecalc *isect_precalc, const float v0[3], const float v1[3], const float v2[3], float *r_dist, float r_uv[2])
void isect_ray_aabb_v3_precalc(struct IsectRayAABB_Precalc *data, const float ray_origin[3], const float ray_direction[3])
float dist_squared_ray_to_seg_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], float r_point[3], float *r_depth)
float dist_squared_ray_to_aabb_v3(const struct DistRayAABB_Precalc *data, const float bb_min[3], const float bb_max[3], float r_point[3], float *r_depth)
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float normalize_v3(float r[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
GPU_PBVH_Buffers * GPU_pbvh_mesh_buffers_build(const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopTri *looptri, const struct MVert *mvert, const int *face_indices, const int *sculpt_face_sets, int face_indices_len, const struct Mesh *mesh)
void GPU_pbvh_buffers_free(GPU_PBVH_Buffers *buffers)
void GPU_pbvh_bmesh_buffers_update(PBVHGPUFormat *vbo_id, struct GPU_PBVH_Buffers *buffers, struct BMesh *bm, struct GSet *bm_faces, struct GSet *bm_unique_verts, struct GSet *bm_other_verts, const int update_flags)
void GPU_pbvh_bmesh_buffers_update_free(GPU_PBVH_Buffers *buffers)
void GPU_pbvh_free_format(PBVHGPUFormat *vbo_id)
@ GPU_PBVH_BUFFERS_SHOW_MASK
@ GPU_PBVH_BUFFERS_SHOW_VCOL
@ GPU_PBVH_BUFFERS_SHOW_SCULPT_FACE_SETS
void GPU_pbvh_mesh_buffers_update(PBVHGPUFormat *vbo_id, GPU_PBVH_Buffers *buffers, const struct MVert *mvert, const CustomData *vdata, const CustomData *ldata, const float *vmask, const int *sculpt_face_sets, const int face_sets_color_seed, const int face_sets_color_default, const int update_flags, const float(*vert_normals)[3])
void GPU_pbvh_grid_buffers_update(PBVHGPUFormat *vbo_id, GPU_PBVH_Buffers *buffers, struct SubdivCCG *subdiv_ccg, struct CCGElem **grids, const struct DMFlagMat *grid_flag_mats, int *grid_indices, int totgrid, const int *sculpt_face_sets, int face_sets_color_seed, int face_sets_color_default, const struct CCGKey *key, int update_flags)
void GPU_pbvh_buffers_update_flush(GPU_PBVH_Buffers *buffers)
GPU_PBVH_Buffers * GPU_pbvh_grid_buffers_build(int totgrid, unsigned int **grid_hidden, bool smooth)
GPU_PBVH_Buffers * GPU_pbvh_bmesh_buffers_build(bool smooth_shading)
bool GPU_pbvh_attribute_names_update(PBVHType pbvh_type, PBVHGPUFormat *vbo_id, const struct CustomData *vdata, const struct CustomData *ldata, bool active_attrs_only)
void GPU_pbvh_grid_buffers_update_free(GPU_PBVH_Buffers *buffers, const struct DMFlagMat *grid_flag_mats, const int *grid_indices)
PBVHGPUFormat * GPU_pbvh_make_format(void)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
#define MEM_reallocN(vmemh, len)
Platform independent time functions.
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE float atomic_add_and_fetch_fl(float *p, const float x)
#define BM_elem_flag_test(ele, hflag)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static unsigned long seed
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_gpu_kernel_postfix int ccl_global int * indices
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_recallocN_id)(void *vmemh, size_t len, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void clear(Message *msg)
static const pxr::TfToken g("g", pxr::TfToken::Immortal)
static void update(bNodeTree *ntree)
SocketIndexByIdentifierMap * map
smooth(Type::FLOAT, "mask_weight")
static PlaneAABBIsect test_frustum_aabb(const float bb_min[3], const float bb_max[3], PBVHFrustumPlanes *frustum)
bool BKE_pbvh_node_fully_masked_get(PBVHNode *node)
static float dist_squared_ray_to_tri_v3_fast(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float r_point[3], float *r_depth)
static void pbvh_build(PBVH *pbvh, BB *cb, BBC *prim_bbc, int totprim)
bool ray_face_nearest_tri(const float ray_start[3], const float ray_normal[3], const float t0[3], const float t1[3], const float t2[3], float *depth, float *dist_sq)
int BKE_pbvh_get_grid_num_faces(const PBVH *pbvh)
void BKE_pbvh_node_free_proxies(PBVHNode *node)
void BKE_pbvh_set_frustum_planes(PBVH *pbvh, PBVHFrustumPlanes *planes)
static void pbvh_iter_end(PBVHIter *iter)
static void build_mesh_leaf_node(PBVH *pbvh, PBVHNode *node)
void BKE_pbvh_node_mark_update(PBVHNode *node)
BLI_bitmap ** BKE_pbvh_get_grid_visibility(const PBVH *pbvh)
void BKE_pbvh_node_get_bm_orco_data(PBVHNode *node, int(**r_orco_tris)[3], int *r_orco_tris_num, float(**r_orco_coords)[3])
void BKE_pbvh_build_grids(PBVH *pbvh, CCGElem **grids, int totgrid, CCGKey *key, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap **grid_hidden)
static void node_tree_insert(node_tree *tree, node_tree *new_node)
void BKE_pbvh_sync_face_sets_to_grids(PBVH *pbvh)
static bool grid_materials_match(const DMFlagMat *f1, const DMFlagMat *f2)
void BKE_pbvh_node_fully_masked_set(PBVHNode *node, int fully_masked)
static int partition_indices(int *prim_indices, int lo, int hi, int axis, float mid, BBC *prim_bbc)
struct PBVHUpdateData PBVHUpdateData
void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3])
void BKE_pbvh_is_drawing_set(PBVH *pbvh, bool val)
void BKE_pbvh_subdiv_cgg_set(PBVH *pbvh, SubdivCCG *subdiv_ccg)
void BKE_pbvh_node_mark_update_visibility(PBVHNode *node)
struct CCGElem ** BKE_pbvh_get_grids(const PBVH *pbvh)
void BKE_pbvh_node_mark_update_color(PBVHNode *node)
static void BKE_pbvh_search_callback_occluded(PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, BKE_pbvh_HitOccludedCallback hcb, void *hit_data)
void BKE_pbvh_vert_coords_apply(PBVH *pbvh, const float(*vertCos)[3], const int totvert)
void BKE_pbvh_get_frustum_planes(PBVH *pbvh, PBVHFrustumPlanes *planes)
static PBVHNode * pbvh_iter_next(PBVHIter *iter)
void BKE_pbvh_raycast_project_ray_root(PBVH *pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot)
void BKE_pbvh_redraw_BB(PBVH *pbvh, float bb_min[3], float bb_max[3])
void BKE_pbvh_node_num_verts(PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert)
void BKE_pbvh_node_get_loops(PBVH *pbvh, PBVHNode *node, const int **r_loop_indices, const MLoop **r_loops)
void BKE_pbvh_build_mesh(PBVH *pbvh, Mesh *mesh, const MPoly *mpoly, const MLoop *mloop, MVert *verts, int totvert, struct CustomData *vdata, struct CustomData *ldata, struct CustomData *pdata, const MLoopTri *looptri, int looptri_num)
void BB_expand_with_bb(BB *bb, BB *bb2)
static void pbvh_update_draw_buffer_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
struct node_tree node_tree
void BKE_pbvh_node_fully_unmasked_set(PBVHNode *node, int fully_masked)
void BKE_pbvh_update_bounds(PBVH *pbvh, int flag)
void BKE_pbvh_draw_debug_cb(PBVH *pbvh, void(*draw_fn)(void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag), void *user_data)
static void update_vb(PBVH *pbvh, PBVHNode *node, BBC *prim_bbc, int offset, int count)
static void build_sub(PBVH *pbvh, int node_index, BB *cb, BBC *prim_bbc, int offset, int count)
static void pbvh_faces_update_normals(PBVH *pbvh, PBVHNode **nodes, int totnode)
void BKE_pbvh_update_visibility(PBVH *pbvh)
static void pbvh_iter_begin(PBVHIter *iter, PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data)
void BKE_pbvh_get_grid_updates(PBVH *pbvh, bool clear, void ***r_gridfaces, int *r_totface)
MVert * BKE_pbvh_get_verts(const PBVH *pbvh)
void pbvh_show_mask_set(PBVH *pbvh, bool show_mask)
static int pbvh_flush_bb(PBVH *pbvh, PBVHNode *node, int flag)
static bool ray_aabb_intersect(PBVHNode *node, void *data_v)
static int pbvh_get_buffers_update_flags(PBVH *UNUSED(pbvh))
static bool nearest_to_ray_aabb_dist_sq(PBVHNode *node, void *data_v)
void BKE_pbvh_free(PBVH *pbvh)
int BB_widest_axis(const BB *bb)
void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3])
static bool leaf_needs_material_split(PBVH *pbvh, int offset, int count)
void BKE_pbvh_node_color_buffer_free(PBVH *pbvh)
static bool pbvh_grids_node_nearest_to_ray(PBVH *pbvh, PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
PBVHType BKE_pbvh_type(const PBVH *pbvh)
static void pbvh_update_visibility_redraw_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
void pbvh_show_face_sets_set(PBVH *pbvh, bool show_face_sets)
bool ray_face_nearest_quad(const float ray_start[3], const float ray_normal[3], const float t0[3], const float t1[3], const float t2[3], const float t3[3], float *depth, float *dist_sq)
static bool pbvh_grids_node_raycast(PBVH *pbvh, PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *r_active_vertex_index, int *r_active_grid_index, float *r_face_normal)
float BKE_pbvh_node_get_tmin(PBVHNode *node)
bool BKE_pbvh_is_drawing(const PBVH *pbvh)
void BKE_pbvh_draw_cb(PBVH *pbvh, bool update_only_visible, PBVHFrustumPlanes *update_frustum, PBVHFrustumPlanes *draw_frustum, void(*draw_fn)(void *user_data, GPU_PBVH_Buffers *buffers), void *user_data, bool UNUSED(full_render))
void BKE_pbvh_mark_rebuild_pixels(PBVH *pbvh)
static bool pbvh_draw_search_cb(PBVHNode *node, void *data_v)
void pbvh_grow_nodes(PBVH *pbvh, int totnode)
void pbvh_update_BB_redraw(PBVH *pbvh, PBVHNode **nodes, int totnode, int flag)
bool BKE_pbvh_node_has_vert_with_normal_update_tag(PBVH *pbvh, PBVHNode *node)
static void pbvh_update_visibility(PBVH *pbvh, PBVHNode **nodes, int totnode)
bool ray_face_intersection_tri(const float ray_start[3], struct IsectRayPrecalc *isect_precalc, const float t0[3], const float t1[3], const float t2[3], float *depth)
void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node)
static void pbvh_update_visibility_redraw(PBVH *pbvh, PBVHNode **nodes, int totnode, int flag)
static void pbvh_update_normals_clear_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
bool BKE_pbvh_node_raycast(PBVH *pbvh, PBVHNode *node, float(*origco)[3], bool use_origco, const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *active_vertex_index, int *active_face_grid_index, float *face_normal)
void BKE_pbvh_node_mark_normals_update(PBVHNode *node)
void BKE_pbvh_face_sets_color_set(PBVH *pbvh, int seed, int color_default)
void BKE_pbvh_raycast(PBVH *pbvh, BKE_pbvh_HitOccludedCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
void BKE_pbvh_update_vertex_data(PBVH *pbvh, int flag)
void BKE_pbvh_vert_tag_update_normal(PBVH *pbvh, int index)
bool ray_face_intersection_quad(const float ray_start[3], struct IsectRayPrecalc *isect_precalc, const float t0[3], const float t1[3], const float t2[3], const float t3[3], float *depth)
void BKE_pbvh_search_gather(PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***r_array, int *r_tot)
const float(* BKE_pbvh_get_vert_normals(const PBVH *pbvh))[3]
static void pbvh_update_visibility_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
static void pbvh_bmesh_node_visibility_update(PBVHNode *node)
struct PBVHDrawSearchData PBVHDrawSearchData
static bool pbvh_faces_node_nearest_to_ray(PBVH *pbvh, const PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
static void pbvh_update_normals_accum_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
bool BKE_pbvh_is_deformed(PBVH *pbvh)
void BKE_pbvh_update_active_vcol(PBVH *pbvh, const Mesh *mesh)
int BKE_pbvh_get_grid_num_vertices(const PBVH *pbvh)
int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden, const int *grid_indices, int totgrid, int gridsize)
bool pbvh_has_mask(const PBVH *pbvh)
void BKE_pbvh_update_normals(PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
void pbvh_free_draw_buffers(PBVH *pbvh, PBVHNode *node)
bool BKE_pbvh_node_find_nearest_to_ray(PBVH *pbvh, PBVHNode *node, float(*origco)[3], bool use_origco, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
static void pbvh_update_mask_redraw_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
static bool face_materials_match(const MPoly *f1, const MPoly *f2)
void BKE_pbvh_ensure_node_loops(PBVH *pbvh)
static void pbvh_check_draw_layout(PBVH *pbvh)
PBVHProxyNode * BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node)
static void build_leaf(PBVH *pbvh, int node_index, BBC *prim_bbc, int offset, int count)
static bool update_search_cb(PBVHNode *node, void *data_v)
static void pbvh_stack_push(PBVHIter *iter, PBVHNode *node, bool revisiting)
PBVH * BKE_pbvh_new(void)
static bool pbvh_faces_node_raycast(PBVH *pbvh, const PBVHNode *node, float(*origco)[3], const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *r_active_vertex_index, int *r_active_face_index, float *r_face_normal)
bool BKE_pbvh_has_faces(const PBVH *pbvh)
void BKE_pbvh_pmap_set(PBVH *pbvh, const MeshElemMap *pmap)
bool BKE_pbvh_node_fully_hidden_get(PBVHNode *node)
static void build_grid_leaf_node(PBVH *pbvh, PBVHNode *node)
void BKE_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden)
void BKE_pbvh_grids_update(PBVH *pbvh, CCGElem **grids, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap **grid_hidden)
bool BKE_pbvh_node_frustum_contain_AABB(PBVHNode *node, void *data)
static void pbvh_update_normals_store_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
void BKE_pbvh_node_num_loops(PBVH *pbvh, PBVHNode *node, int *r_totloop)
PBVHColorBufferNode * BKE_pbvh_node_color_buffer_get(PBVHNode *node)
static void pbvh_grids_node_visibility_update(PBVH *pbvh, PBVHNode *node)
const CCGKey * BKE_pbvh_get_grid_key(const PBVH *pbvh)
static void pbvh_faces_node_visibility_update(PBVH *pbvh, PBVHNode *node)
bool BKE_pbvh_node_frustum_exclude_AABB(PBVHNode *node, void *data)
void BKE_pbvh_respect_hide_set(PBVH *pbvh, bool respect_hide)
void BKE_pbvh_node_mark_update_mask(PBVHNode *node)
void BBC_update_centroid(BBC *bbc)
void BKE_pbvh_node_get_verts(PBVH *pbvh, PBVHNode *node, const int **r_vert_indices, MVert **r_verts)
bool BKE_pbvh_get_color_layer(const Mesh *me, CustomDataLayer **r_layer, eAttrDomain *r_attr)
static int map_insert_vert(PBVH *pbvh, GHash *map, unsigned int *face_verts, unsigned int *uniq_verts, int vertex)
bool BKE_pbvh_node_fully_unmasked_get(PBVHNode *node)
BMesh * BKE_pbvh_get_bmesh(PBVH *pbvh)
static void pbvh_update_BB_redraw_task_cb(void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
BLI_bitmap ** BKE_pbvh_grid_hidden(const PBVH *pbvh)
static int partition_indices_material(PBVH *pbvh, int lo, int hi)
static void update_node_vb(PBVH *pbvh, PBVHNode *node)
void BKE_pbvh_bounding_box(const PBVH *pbvh, float min[3], float max[3])
void BKE_pbvh_search_callback(PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, BKE_pbvh_HitCallback hcb, void *hit_data)
bool BKE_pbvh_draw_cache_invalid(const PBVH *pbvh)
void BKE_pbvh_node_mark_redraw(PBVHNode *node)
#define STACK_FIXED_DEPTH
static PBVHNode * pbvh_iter_next_occluded(PBVHIter *iter)
static void traverse_tree(node_tree *tree, BKE_pbvh_HitOccludedCallback hcb, void *hit_data, float *tmin)
void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int mode)
void BKE_pbvh_node_get_grids(PBVH *pbvh, PBVHNode *node, int **r_grid_indices, int *r_totgrid, int *r_maxgrid, int *r_gridsize, CCGElem ***r_griddata)
struct PBVHStack PBVHStack
static void pbvh_update_mask_redraw(PBVH *pbvh, PBVHNode **nodes, int totnode, int flag)
void BKE_pbvh_face_sets_set(PBVH *pbvh, int *face_sets)
void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count)
void BKE_pbvh_find_nearest_to_ray(PBVH *pbvh, BKE_pbvh_SearchNearestCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
static void free_tree(node_tree *tree)
float(* BKE_pbvh_vert_coords_alloc(PBVH *pbvh))[3]
void BB_expand(BB *bb, const float co[3])
static void pbvh_update_draw_buffers(PBVH *pbvh, PBVHNode **nodes, int totnode, int update_flag)
void BKE_pbvh_parallel_range_settings(TaskParallelSettings *settings, bool use_threading, int totnode)
bool pbvh_has_face_sets(PBVH *pbvh)
bool pbvh_bmesh_node_nearest_to_ray(PBVHNode *node, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq, bool use_original)
bool pbvh_bmesh_node_raycast(PBVHNode *node, const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, bool use_original, int *r_active_vertex_index, float *r_face_normal)
void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode)
@ PBVH_DYNTOPO_SMOOTH_SHADING
void pbvh_pixels_free(PBVHNode *node)
struct DistRayAABB_Precalc dist_ray_to_aabb_precalc
int face_sets_color_default
PBVHFrustumPlanes * frustum
PBVHStack stackfixed[STACK_FIXED_DEPTH]
BKE_pbvh_SearchCallback scb
bool show_sculpt_face_sets
BLI_bitmap ** grid_hidden
struct GSetIterator bm_other_verts
struct GSetIterator bm_unique_verts
struct CustomData * bm_vdata
const DMFlagMat * grid_flag_mats
BLI_bitmap ** grid_hidden
const struct MPoly * mpoly
const struct MeshElemMap * pmap
struct PBVHGPUFormat * vbo_id
const struct MLoop * mloop
const struct MLoopTri * looptri
struct SubdivCCG * subdiv_ccg
int face_sets_color_default
CustomDataLayer * color_layer
struct IsectRayAABB_Precalc ray