Blender V4.3
blender::bke::pbvh::MeshNode Struct Reference

#include <BKE_pbvh_api.hh>

Inherits blender::bke::pbvh::Node.

Public Types

using LocalVertMapIndexT = int16_t
 
using LocalVertMap
 

Public Member Functions

Span< intfaces () const
 
Span< intverts () const
 
Span< intall_verts () const
 
int corners_num () const
 

Public Attributes

Span< intface_indices_
 
LocalVertMap vert_indices_
 
int unique_verts_num_ = 0
 
int corners_num_
 
- Public Attributes inherited from blender::bke::pbvh::Node
Bounds< float3bounds_ = {}
 
Bounds< float3bounds_orig_ = {}
 
int children_offset_ = 0
 
PBVHNodeFlags flag_ = PBVH_UpdateRedraw
 
float tmin_ = 0.0f
 
int debug_draw_gen_ = 0
 
pixels::NodeDatapixels_ = nullptr
 

Detailed Description

Definition at line 104 of file BKE_pbvh_api.hh.

Member Typedef Documentation

◆ LocalVertMap

Initial value:
VectorSet<int,
DefaultHash<int>,
DefaultEquality<int>,
SimpleVectorSetSlot<int, LocalVertMapIndexT>,
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
PythonProbingStrategy<> DefaultProbingStrategy

Global vertices are mapped to local indices with a vector set, with a specialized type in order to use 32 bit integers for slot values. .

Definition at line 114 of file BKE_pbvh_api.hh.

◆ LocalVertMapIndexT

Use a 16 bit integer for the slot index type because there will always be less than leaf_limit vertices in a node.

Definition at line 109 of file BKE_pbvh_api.hh.

Member Function Documentation

◆ all_verts()

Span< int > blender::bke::pbvh::MeshNode::all_verts ( ) const
inline

Return all vertices used by faces in this node. The same as verts(), with the shared vertices added at the end of the array.

Definition at line 626 of file BKE_pbvh_api.hh.

References vert_indices_.

◆ corners_num()

int blender::bke::pbvh::MeshNode::corners_num ( ) const
inline

The number of corners in all of the node's faces.

Definition at line 630 of file BKE_pbvh_api.hh.

References corners_num_.

◆ faces()

Span< int > blender::bke::pbvh::MeshNode::faces ( ) const
inline

Return the faces contained by the node.

Definition at line 618 of file BKE_pbvh_api.hh.

References face_indices_.

◆ verts()

Span< int > blender::bke::pbvh::MeshNode::verts ( ) const
inline

Return the "unique" vertices owned by the node, excluding vertices owned by other nodes.

Definition at line 622 of file BKE_pbvh_api.hh.

References blender::VectorSet< Key, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), blender::Span< T >::slice(), unique_verts_num_, and vert_indices_.

Member Data Documentation

◆ corners_num_

int blender::bke::pbvh::MeshNode::corners_num_

The number of corners in all of the node's referenced faces. This value can easily be recalculated but currently it's faster to avoid that and store it here.

Definition at line 153 of file BKE_pbvh_api.hh.

Referenced by corners_num().

◆ face_indices_

Span<int> blender::bke::pbvh::MeshNode::face_indices_

Indices into the #Mesh::faces() array. Refers to a subset of Tree::prim_indices_.

Definition at line 122 of file BKE_pbvh_api.hh.

Referenced by faces().

◆ unique_verts_num_

int blender::bke::pbvh::MeshNode::unique_verts_num_ = 0

The number of vertices in #vert_indices not shared with (owned by) another node.

Definition at line 148 of file BKE_pbvh_api.hh.

Referenced by verts().

◆ vert_indices_

LocalVertMap blender::bke::pbvh::MeshNode::vert_indices_

Array of indices into the mesh's vertex array. Contains the indices of all vertices used by faces that are within this node's bounding box.

Note that a vertex might be used by a multiple faces, and these faces might be in different leaf nodes. Such a vertex will appear in the vert_indices array of each of those leaf nodes.

In order to support cases where you want access to multiple nodes' vertices without duplication, the vert_indices array is ordered such that the first part of the array, up to index 'uniq_verts', contains "unique" vertex indices. These vertices might not be truly unique to this node, but if they appear in another node's vert_indices array, they will be above that node's 'uniq_verts' value.

Used for leaf nodes.

Todo
Find a way to disable the #VectorSet inline buffer.

Definition at line 146 of file BKE_pbvh_api.hh.

Referenced by all_verts(), and verts().


The documentation for this struct was generated from the following file: