diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-04-11 19:47:40 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-04-11 19:47:55 +0300 |
commit | e7a69b438f0f731e817a90b6df6b08d3951ab342 (patch) | |
tree | 965f8abfab78f118fba85841affad020ff2c9e4a /source/blender/blenkernel/intern/pbvh_intern.h | |
parent | 0329145712a1748431a4d6fed705af6a22ecd0e4 (diff) |
Cleanup: Clarify a few comments in pbvh_intern.h
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_intern.h')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_intern.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h index 37f8dfd9b6b..ea1f0632f32 100644 --- a/source/blender/blenkernel/intern/pbvh_intern.h +++ b/source/blender/blenkernel/intern/pbvh_intern.h @@ -32,13 +32,18 @@ struct PBVHNode { * 'nodes' array. */ int children_offset; - /* Pointer into the PBVH prim_indices array and the number of - * primitives used by this leaf node. + /* List of primitives for this node. Semantics depends on + * PBVH type: * - * Used for leaf nodes in both mesh- and multires-based PBVHs. + * - PBVH_FACES: Indices into the PBVH.looptri array. + * - PBVH_GRIDS: Multires grid indices. + * - PBVH_BMESH: Unused. See PBVHNode.bm_faces. + * + * NOTE: This is a pointer inside of PBVH.prim_indices; it + * is not allocated separately per node. */ int *prim_indices; - unsigned int totprim; + unsigned int totprim; /* Number of primitives inside prim_indices. */ /* Array of indices into the mesh's MVert array. Contains the * indices of all vertices used by faces that are within this @@ -63,9 +68,8 @@ struct PBVHNode { unsigned int uniq_verts, face_verts; /* Array of indices into the Mesh's MLoop array. - * PBVH_FACES only. The first part of the array - * are loops unique to this node, see comment for - * vert_indices for more details.*/ + * PBVH_FACES only. + */ int *loop_indices; unsigned int loop_indices_num; @@ -93,6 +97,11 @@ struct PBVHNode { PBVHProxyNode *proxies; /* Dyntopo */ + + /* GSet of pointers to the BMFaces used by this node. + * NOTE: PBVH_BMESH only. Faces are always triangles + * (dynamic topology forcibly triangulates the mesh). + */ GSet *bm_faces; GSet *bm_unique_verts; GSet *bm_other_verts; @@ -117,6 +126,7 @@ struct PBVH { PBVHNode *nodes; int node_mem_count, totnode; + /* Memory backing for PBVHNode.prim_indices. */ int *prim_indices; int totprim; int totvert; |