Blender V5.0
BKE_paint_bvh.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11
12#include <variant>
13
14#include "BLI_array.hh"
16#include "BLI_bit_vector.hh"
17#include "BLI_bounds_types.hh"
18#include "BLI_function_ref.hh"
19#include "BLI_index_mask_fwd.hh"
20#include "BLI_math_vector.hh"
22#include "BLI_offset_indices.hh"
23#include "BLI_set.hh"
24#include "BLI_span.hh"
25#include "BLI_string_ref.hh"
26#include "BLI_utildefines.h"
27#include "BLI_utility_mixins.hh"
28#include "BLI_vector.hh"
29#include "BLI_vector_set.hh"
30
31struct BMFace;
32struct BMLog;
33struct BMesh;
34struct BMVert;
35struct CCGKey;
36struct Depsgraph;
37struct IsectRayPrecalc;
38struct Mesh;
39struct SubdivCCG;
40struct SubdivCCGCoord;
41struct Image;
42struct ImageUser;
43struct Object;
44
45namespace blender::bke::pbvh {
46class Node;
47class Tree;
48namespace pixels {
49struct PBVHData;
50struct NodeData;
51} // namespace pixels
52} // namespace blender::bke::pbvh
53
54namespace blender::bke::pbvh {
55
56class Tree;
57
63 friend Tree;
64
65 public:
66 enum Flags : uint32_t {
67 None = 0,
68 Leaf = 1 << 0,
69
70 FullyHidden = 1 << 10,
71 FullyMasked = 1 << 11,
72 FullyUnmasked = 1 << 12,
73
74 UpdateTopology = 1 << 13,
75 RebuildPixels = 1 << 15,
76 TexLeaf = 1 << 16,
78 TopologyUpdated = 1 << 17,
79 };
80
81 /* Index of the parent node. A value of -1 indicates that the node is the root node. */
82 int parent_ = -1;
83
88
89 /* For internal nodes, the offset of the children in the blender::bke::pbvh::Tree
90 * 'nodes' array. */
92
93 /* Indicates whether this node is a leaf or not; also used for
94 * marking various updates that need to be applied. */
96
101 float tmin_ = 0.0f;
102
109
112
113 std::optional<int> parent() const;
114 const Bounds<float3> &bounds() const;
115 const Bounds<float3> &bounds_orig() const;
116};
117
119
180
181struct GridsNode : public Node {
184
186 Span<int> grids() const;
187};
188
209
211 public:
212 virtual ~DrawCache() = default;
213 virtual void tag_positions_changed(const IndexMask &node_mask) = 0;
214 virtual void tag_visibility_changed(const IndexMask &node_mask) = 0;
215 virtual void tag_topology_changed(const IndexMask &node_mask) = 0;
216 virtual void tag_face_sets_changed(const IndexMask &node_mask) = 0;
217 virtual void tag_masks_changed(const IndexMask &node_mask) = 0;
218 virtual void tag_attribute_changed(const IndexMask &node_mask, StringRef attribute_name) = 0;
219};
220
221enum class Type {
225};
226
231class Tree {
232 friend Node;
233 Type type_;
234
236 Array<int, 0> prim_indices_;
237
243 BitVector<> bounds_dirty_;
244
250 BitVector<> normals_dirty_;
251
257 BitVector<> visibility_dirty_;
258
259 public:
260 std::variant<Vector<MeshNode>, Vector<GridsNode>, Vector<BMeshNode>> nodes_;
261
263
264 std::unique_ptr<DrawCache> draw_data;
265
266 Tree(const Tree &other) = delete;
267 Tree(Tree &&other) = default;
268 Tree &operator=(const Tree &other) = delete;
269 Tree &operator=(Tree &&other) = default;
270 ~Tree();
271
273 static Tree from_mesh(const Mesh &mesh);
275 static Tree from_grids(const Mesh &base_mesh, const SubdivCCG &subdiv_ccg);
277 static Tree from_bmesh(BMesh &bm);
278
279 int nodes_num() const;
280 template<typename NodeT> Span<NodeT> nodes() const;
281 template<typename NodeT> MutableSpan<NodeT> nodes();
282
283 Type type() const;
284
290 void tag_positions_changed(const IndexMask &node_mask);
291
293 void tag_visibility_changed(const IndexMask &node_mask);
294
298 void tag_topology_changed(const IndexMask &node_mask);
299
301 void tag_face_sets_changed(const IndexMask &node_mask);
302
304 void tag_masks_changed(const IndexMask &node_mask);
305
309 void tag_attribute_changed(const IndexMask &node_mask, StringRef attribute_name);
310
317
322 void update_bounds(const Depsgraph &depsgraph, const Object &object);
323 void update_bounds_mesh(Span<float3> vert_positions);
324 void update_bounds_grids(Span<float3> positions, int grid_area);
325 void update_bounds_bmesh(const BMesh &bm);
326
327 void update_normals(Object &object_orig, Object &object_eval);
328
329 void update_visibility(const Object &object);
330
331 private:
332 explicit Tree(Type type);
334 static Tree from_spatially_organized_mesh(const Mesh &mesh);
335};
336
337void build_pixels(const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user);
338
339/* Ray-cast
340 * the hit callback is called for all leaf nodes intersecting the ray;
341 * it's up to the callback to find the primitive within the leaves that is
342 * hit first */
343
345 FunctionRef<void(Node &node, float *tmin)> hit_fn,
346 const float3 &ray_start,
347 const float3 &ray_normal,
348 bool original);
349
350inline Bounds<float3> calc_face_bounds(const Span<float3> vert_positions,
351 const Span<int> face_verts)
352{
353 Bounds<float3> bounds{vert_positions[face_verts.first()]};
354 for (const int vert : face_verts.slice(1, face_verts.size() - 1)) {
355 math::min_max(vert_positions[vert], bounds.min, bounds.max);
356 }
357 return bounds;
358}
359
360int partition_along_axis(const Span<float3> face_centers,
362 const int axis,
363 const float middle);
364
366
367bool leaf_needs_material_split(const Span<int> faces, const Span<int> material_indices);
368
369bool node_raycast_mesh(const MeshNode &node,
370 Span<float3> node_positions,
371 Span<float3> vert_positions,
373 Span<int> corner_verts,
374 Span<int3> corner_tris,
375 Span<bool> hide_poly,
376 const float3 &ray_start,
377 const float3 &ray_normal,
378 IsectRayPrecalc *isect_precalc,
379 float *depth,
380 int &r_active_vertex,
381 int &r_active_face_index,
382 float3 &r_face_normal);
383
384bool node_raycast_grids(const SubdivCCG &subdiv_ccg,
385 GridsNode &node,
386 Span<float3> node_positions,
387 const float3 &ray_start,
388 const float3 &ray_normal,
389 const IsectRayPrecalc *isect_precalc,
390 float *depth,
391 SubdivCCGCoord &r_active_vertex,
392 int &r_active_grid_index,
393 float3 &r_face_normal);
394
395bool node_raycast_bmesh(BMeshNode &node,
396 const float3 &ray_start,
397 const float3 &ray_normal,
398 const IsectRayPrecalc *isect_precalc,
399 float *depth,
400 bool use_original,
401 BMVert **r_active_vertex,
402 float3 &r_face_normal);
403
404bool raycast_node_detail_bmesh(const BMeshNode &node,
405 const float3 &ray_start,
406 const IsectRayPrecalc *isect_precalc,
407 float *depth,
408 float *r_edge_length);
409
420void clip_ray_ortho(
421 Tree &pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3]);
422
423void find_nearest_to_ray(Tree &pbvh,
424 const FunctionRef<void(Node &node, float *tmin)> fn,
425 const float3 &ray_start,
426 const float3 &ray_normal,
427 bool original);
428
430 Node &node,
431 Span<float3> node_positions,
432 bool use_origco,
433 Span<float3> vert_positions,
435 Span<int> corner_verts,
436 Span<int3> corner_tris,
437 Span<bool> hide_poly,
438 const SubdivCCG *subdiv_ccg,
439 const float ray_start[3],
440 const float ray_normal[3],
441 float *depth,
442 float *dist_sq);
443
447Bounds<float3> bounds_get(const Tree &pbvh);
448
452bool node_frustum_contain_aabb(const Node &node, Span<float4> frustum_planes);
453
457bool node_frustum_exclude_aabb(const Node &node, Span<float4> frustum_planes);
458
459} // namespace blender::bke::pbvh
460
462
463namespace blender::bke::pbvh {
464
468int count_grid_quads(const BitGroupVector<> &grid_hidden,
469 Span<int> grid_indices,
470 int gridsize,
471 int display_gridsize);
472
473} // namespace blender::bke::pbvh
474
475int BKE_pbvh_get_grid_num_verts(const Object &object);
476int BKE_pbvh_get_grid_num_faces(const Object &object);
477
483
484namespace blender::bke::pbvh {
485
490 Tree &pbvh,
491 BMLog &bm_log,
493 float min_edge_len,
494 float max_edge_len,
495 const float3 &center,
496 const std::optional<float3> &view_normal,
497 float radius,
498 bool use_frontface,
499 bool use_projected);
500
501} // namespace blender::bke::pbvh
502
503/* Node Access */
504
507void BKE_pbvh_node_fully_hidden_set(blender::bke::pbvh::Node &node, int fully_hidden);
509void BKE_pbvh_node_fully_masked_set(blender::bke::pbvh::Node &node, int fully_masked);
513
515
516namespace blender::bke::pbvh {
517
522Span<int> node_face_indices_calc_grids(const SubdivCCG &subdiv_ccg,
523 const GridsNode &node,
524 Vector<int> &faces);
525
526} // namespace blender::bke::pbvh
527
529
535
543 BMLog *log,
545 bool use_original);
547
548namespace blender::bke::pbvh {
549
556void store_bounds_orig(Tree &pbvh);
557
559void update_mask_mesh(const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh);
560void update_mask_grids(const SubdivCCG &subdiv_ccg, const IndexMask &node_mask, Tree &pbvh);
561void update_mask_bmesh(const BMesh &bm, const IndexMask &node_mask, Tree &pbvh);
562
563void update_normals(const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh);
565void update_normals_from_eval(Object &object_eval, Tree &pbvh);
566
567} // namespace blender::bke::pbvh
568
569namespace blender::bke::pbvh {
570IndexMask nodes_to_face_selection_grids(const SubdivCCG &subdiv_ccg,
571 Span<GridsNode> nodes,
572 const IndexMask &nodes_mask,
573 IndexMaskMemory &memory);
574}
575
577 blender::Span<blender::float3> vert_positions);
578
580 blender::Span<blender::float3> &r_orig_positions,
581 blender::Span<blender::int3> &r_orig_tris);
582
583namespace blender::bke::pbvh {
584
590Span<float3> vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig);
591Span<float3> vert_positions_eval_from_eval(const Object &object_eval);
592
599MutableSpan<float3> vert_positions_eval_for_write(const Depsgraph &depsgraph, Object &object_orig);
600
605Span<float3> vert_normals_eval(const Depsgraph &depsgraph, const Object &object_orig);
606Span<float3> vert_normals_eval_from_eval(const Object &object_eval);
607
608Span<float3> face_normals_eval_from_eval(const Object &object_eval);
609
610} // namespace blender::bke::pbvh
611
613
614namespace blender::bke::pbvh {
615
617IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory);
618
620IndexMask search_nodes(const Tree &pbvh,
621 IndexMaskMemory &memory,
622 FunctionRef<bool(const Node &)> filter_fn);
623
624void node_update_mask_mesh(Span<float> mask, MeshNode &node);
625void node_update_mask_grids(const CCGKey &key, Span<float> masks, GridsNode &node);
626void node_update_mask_bmesh(int mask_offset, BMeshNode &node);
627
628void node_update_visibility_mesh(Span<bool> hide_vert, MeshNode &node);
629void node_update_visibility_grids(const BitGroupVector<> &grid_hidden, GridsNode &node);
631
632void update_node_bounds_mesh(Span<float3> positions, MeshNode &node);
633void update_node_bounds_grids(int grid_area, Span<float3> positions, GridsNode &node);
635
636inline std::optional<int> Node::parent() const
637{
638 if (parent_ == -1) {
639 return std::nullopt;
640 }
641
642 return parent_;
643}
644
645inline const Bounds<float3> &Node::bounds() const
646{
647 return bounds_;
648}
649
651{
652 return bounds_orig_;
653}
654
656{
657 return face_indices_;
658}
660{
661 return vert_indices_.as_span().slice(0, unique_verts_num_);
662}
664{
665 return vert_indices_;
666}
667inline int MeshNode::corners_num() const
668{
669 return corners_num_;
670}
671
673{
674 return prim_indices_;
675}
676
677inline Type Tree::type() const
678{
679 return type_;
680}
681
682} // namespace blender::bke::pbvh
bool BKE_pbvh_node_fully_hidden_get(const blender::bke::pbvh::Node &node)
Definition pbvh.cc:1723
void BKE_pbvh_mark_rebuild_pixels(blender::bke::pbvh::Tree &pbvh)
Definition pbvh.cc:1698
void BKE_pbvh_node_fully_unmasked_set(blender::bke::pbvh::Node &node, int fully_masked)
Definition pbvh.cc:1747
void BKE_pbvh_node_mark_topology_update(blender::bke::pbvh::Node &node)
int BKE_pbvh_debug_draw_gen_get(blender::bke::pbvh::Node &node)
Definition pbvh.cc:2541
int BKE_pbvh_get_grid_num_verts(const Object &object)
Definition pbvh.cc:1675
float BKE_pbvh_node_get_tmin(const blender::bke::pbvh::Node *node)
Definition pbvh.cc:849
void BKE_pbvh_node_mark_update(blender::bke::pbvh::Node &node)
Definition pbvh.cc:1693
bool BKE_pbvh_node_fully_masked_get(const blender::bke::pbvh::Node &node)
Definition pbvh.cc:1741
void BKE_pbvh_bmesh_after_stroke(BMesh &bm, blender::bke::pbvh::Tree &pbvh)
void BKE_pbvh_node_fully_hidden_set(blender::bke::pbvh::Node &node, int fully_hidden)
Definition pbvh.cc:1711
int BKE_pbvh_get_grid_num_faces(const Object &object)
Definition pbvh.cc:1683
const blender::Set< BMFace *, 0 > & BKE_pbvh_bmesh_node_faces(blender::bke::pbvh::BMeshNode *node)
PBVHTopologyUpdateMode
@ PBVH_Collapse
@ PBVH_Subdivide
void BKE_pbvh_node_fully_masked_set(blender::bke::pbvh::Node &node, int fully_masked)
Definition pbvh.cc:1729
const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_unique_verts(blender::bke::pbvh::BMeshNode *node)
void BKE_pbvh_bmesh_node_save_orig(BMesh *bm, BMLog *log, blender::bke::pbvh::BMeshNode *node, bool use_original)
const blender::Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_other_verts(blender::bke::pbvh::BMeshNode *node)
bool BKE_pbvh_node_fully_unmasked_get(const blender::bke::pbvh::Node &node)
Definition pbvh.cc:1759
void BKE_pbvh_vert_coords_apply(blender::bke::pbvh::Tree &pbvh, blender::Span< blender::float3 > vert_positions)
Definition pbvh.cc:2532
void BKE_pbvh_sync_visibility_from_verts(Object &object)
Definition pbvh.cc:2546
void BKE_pbvh_node_get_bm_orco_data(const blender::bke::pbvh::BMeshNode &node, blender::Span< blender::float3 > &r_orig_positions, blender::Span< blender::int3 > &r_orig_tris)
Definition pbvh.cc:1786
#define ENUM_OPERATORS(_type, _max)
struct Object Object
BMesh * bm
BPy_StructRNA * depsgraph
NonCopyable(const NonCopyable &other)=delete
constexpr Span slice(int64_t start, int64_t size) const
Definition BLI_span.hh:137
constexpr const T & first() const
Definition BLI_span.hh:315
constexpr int64_t size() const
Definition BLI_span.hh:252
virtual void tag_visibility_changed(const IndexMask &node_mask)=0
virtual ~DrawCache()=default
virtual void tag_topology_changed(const IndexMask &node_mask)=0
virtual void tag_attribute_changed(const IndexMask &node_mask, StringRef attribute_name)=0
virtual void tag_positions_changed(const IndexMask &node_mask)=0
virtual void tag_masks_changed(const IndexMask &node_mask)=0
virtual void tag_face_sets_changed(const IndexMask &node_mask)=0
Bounds< float3 > bounds_
const Bounds< float3 > & bounds() const
const Bounds< float3 > & bounds_orig() const
pixels::NodeData * pixels_
std::optional< int > parent() const
Bounds< float3 > bounds_orig_
MutableSpan< NodeT > nodes()
void update_normals(Object &object_orig, Object &object_eval)
Definition pbvh.cc:1229
void tag_attribute_changed(const IndexMask &node_mask, StringRef attribute_name)
Definition pbvh.cc:676
Tree(const Tree &other)=delete
void tag_positions_changed(const IndexMask &node_mask)
Definition pbvh.cc:635
static Tree from_bmesh(BMesh &bm)
Tree & operator=(const Tree &other)=delete
Span< NodeT > nodes() const
void update_bounds(const Depsgraph &depsgraph, const Object &object)
Definition pbvh.cc:1386
int nodes_num() const
Definition pbvh.cc:590
void update_bounds_grids(Span< float3 > positions, int grid_area)
Definition pbvh.cc:1359
void tag_face_sets_changed(const IndexMask &node_mask)
Definition pbvh.cc:662
Tree & operator=(Tree &&other)=default
void tag_masks_changed(const IndexMask &node_mask)
Definition pbvh.cc:669
std::unique_ptr< DrawCache > draw_data
void tag_visibility_changed(const IndexMask &node_mask)
Definition pbvh.cc:646
void update_visibility(const Object &object)
Definition pbvh.cc:1579
static Tree from_grids(const Mesh &base_mesh, const SubdivCCG &subdiv_ccg)
Definition pbvh.cc:471
static Tree from_mesh(const Mesh &mesh)
Definition pbvh.cc:306
void tag_topology_changed(const IndexMask &node_mask)
Definition pbvh.cc:655
Tree(Tree &&other)=default
void update_bounds_mesh(Span< float3 > vert_positions)
Definition pbvh.cc:1346
void update_bounds_bmesh(const BMesh &bm)
Definition pbvh.cc:1373
pixels::PBVHData * pixels_
std::variant< Vector< MeshNode >, Vector< GridsNode >, Vector< BMeshNode > > nodes_
void flush_bounds_to_parents()
Definition pbvh.cc:1306
#define log
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
static char faces[256]
void raycast(Tree &pbvh, FunctionRef< void(Node &node, float *tmin)> hit_fn, const float3 &ray_start, const float3 &ray_normal, bool original)
IndexMask search_nodes(const Tree &pbvh, IndexMaskMemory &memory, FunctionRef< bool(const Node &)> filter_fn)
Definition pbvh.cc:2663
Bounds< float3 > calc_face_bounds(const Span< float3 > vert_positions, const Span< int > face_verts)
void update_mask_bmesh(const BMesh &bm, const IndexMask &node_mask, Tree &pbvh)
Definition pbvh.cc:1496
void update_normals(const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh)
Definition pbvh.cc:1257
void update_mask_mesh(const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh)
Definition pbvh.cc:1432
Span< float3 > vert_normals_eval_from_eval(const Object &object_eval)
Definition pbvh.cc:1065
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
Definition pbvh.cc:2628
void clip_ray_ortho(Tree &pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
Definition pbvh.cc:2182
int count_grid_quads(const BitGroupVector<> &grid_hidden, Span< int > grid_indices, int gridsize, int display_gridsize)
Definition pbvh.cc:1605
bool node_raycast_mesh(const MeshNode &node, Span< float3 > node_positions, Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< bool > hide_poly, const float3 &ray_start, const float3 &ray_normal, IsectRayPrecalc *isect_precalc, float *depth, int &r_active_vertex, int &r_active_face_index, float3 &r_face_normal)
Definition pbvh.cc:1976
void update_node_bounds_bmesh(BMeshNode &node)
Definition pbvh.cc:1294
int partition_along_axis(const Span< float3 > face_centers, MutableSpan< int > faces, const int axis, const float middle)
Definition pbvh.cc:61
bool node_frustum_exclude_aabb(const Node &node, Span< float4 > frustum_planes)
Definition pbvh.cc:2525
Span< float3 > vert_positions_eval_from_eval(const Object &object_eval)
Definition pbvh.cc:1046
void node_update_mask_bmesh(int mask_offset, BMeshNode &node)
Definition pbvh.cc:1479
void node_update_mask_mesh(Span< float > mask, MeshNode &node)
Definition pbvh.cc:1421
void node_update_visibility_grids(const BitGroupVector<> &grid_hidden, GridsNode &node)
Definition pbvh.cc:1536
bool node_raycast_bmesh(BMeshNode &node, const float3 &ray_start, const float3 &ray_normal, const IsectRayPrecalc *isect_precalc, float *depth, bool use_original, BMVert **r_active_vertex, float3 &r_face_normal)
void node_update_mask_grids(const CCGKey &key, Span< float > masks, GridsNode &node)
Definition pbvh.cc:1449
bool node_raycast_grids(const SubdivCCG &subdiv_ccg, GridsNode &node, Span< float3 > node_positions, const float3 &ray_start, const float3 &ray_normal, const IsectRayPrecalc *isect_precalc, float *depth, SubdivCCGCoord &r_active_vertex, int &r_active_grid_index, float3 &r_face_normal)
Definition pbvh.cc:2092
void update_node_bounds_mesh(Span< float3 > positions, MeshNode &node)
Definition pbvh.cc:1274
void node_update_visibility_bmesh(BMeshNode &node)
Definition pbvh.cc:1560
Bounds< float3 > bounds_get(const Tree &pbvh)
Definition pbvh.cc:1661
void update_normals_from_eval(Object &object_eval, Tree &pbvh)
Definition pbvh.cc:1264
Span< float3 > vert_normals_eval(const Depsgraph &depsgraph, const Object &object_orig)
Definition pbvh.cc:1059
IndexMask nodes_to_face_selection_grids(const SubdivCCG &subdiv_ccg, Span< GridsNode > nodes, const IndexMask &nodes_mask, IndexMaskMemory &memory)
Definition pbvh.cc:1643
void update_mask_grids(const SubdivCCG &subdiv_ccg, const IndexMask &node_mask, Tree &pbvh)
Definition pbvh.cc:1463
MutableSpan< float3 > vert_positions_eval_for_write(const Depsgraph &depsgraph, Object &object_orig)
Definition pbvh.cc:1053
bool bmesh_update_topology(BMesh &bm, Tree &pbvh, BMLog &bm_log, PBVHTopologyUpdateMode mode, float min_edge_len, float max_edge_len, const float3 &center, const std::optional< float3 > &view_normal, float radius, bool use_frontface, bool use_projected)
bool raycast_node_detail_bmesh(const BMeshNode &node, const float3 &ray_start, const IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length)
bool leaf_needs_material_split(const Span< int > faces, const Span< int > material_indices)
Definition pbvh.cc:133
int partition_material_indices(const Span< int > material_indices, MutableSpan< int > faces)
Definition pbvh.cc:72
Span< float3 > face_normals_eval_from_eval(const Object &object_eval)
Definition pbvh.cc:1072
void update_node_bounds_grids(int grid_area, Span< float3 > positions, GridsNode &node)
Definition pbvh.cc:1283
bool node_frustum_contain_aabb(const Node &node, Span< float4 > frustum_planes)
Definition pbvh.cc:2520
void build_pixels(const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user)
bool find_nearest_to_ray_node(Tree &pbvh, Node &node, Span< float3 > node_positions, bool use_origco, Span< float3 > vert_positions, const OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< bool > hide_poly, const SubdivCCG *subdiv_ccg, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
Definition pbvh.cc:2432
void store_bounds_orig(Tree &pbvh)
Definition pbvh.cc:1408
Span< int > node_face_indices_calc_grids(const SubdivCCG &subdiv_ccg, const GridsNode &node, Vector< int > &faces)
Definition pbvh.cc:1767
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
Definition pbvh.cc:1040
void node_update_visibility_mesh(Span< bool > hide_vert, MeshNode &node)
Definition pbvh.cc:1512
void find_nearest_to_ray(Tree &pbvh, const FunctionRef< void(Node &node, float *tmin)> fn, const float3 &ray_start, const float3 &ray_normal, bool original)
Definition pbvh.cc:2294
void min_max(const T &value, T &min, T &max)
PythonProbingStrategy<> DefaultProbingStrategy
VecBase< float, 3 > float3
Array< BMVert *, 0 > orig_verts_
Array< float3, 0 > orig_positions_
Set< BMVert *, 0 > bm_unique_verts_
Set< BMVert *, 0 > bm_other_verts_
Span< int > all_verts() const
VectorSet< int, 0, DefaultProbingStrategy, DefaultHash< int >, DefaultEquality< int >, SimpleVectorSetSlot< int, LocalVertMapIndexT >, GuardedAllocator > LocalVertMap