[Bf-blender-cvs] [e7a69b438f0] master: Cleanup: Clarify a few comments in pbvh_intern.h
Joseph Eagar
noreply at git.blender.org
Mon Apr 11 18:48:07 CEST 2022
Commit: e7a69b438f0f731e817a90b6df6b08d3951ab342
Author: Joseph Eagar
Date: Mon Apr 11 09:47:40 2022 -0700
Branches: master
https://developer.blender.org/rBe7a69b438f0f731e817a90b6df6b08d3951ab342
Cleanup: Clarify a few comments in pbvh_intern.h
===================================================================
M source/blender/blenkernel/intern/pbvh_intern.h
===================================================================
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;
More information about the Bf-blender-cvs
mailing list