diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv.h')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv.h b/source/blender/blenkernel/BKE_subdiv.h index 2fb27fad30d..169a4337f6a 100644 --- a/source/blender/blenkernel/BKE_subdiv.h +++ b/source/blender/blenkernel/BKE_subdiv.h @@ -188,7 +188,16 @@ typedef struct Subdiv { /* Cached values, are not supposed to be accessed directly. */ struct { /* Indexed by base face index, element indicates total number of ptex - * faces created for preceding base faces. */ + * faces created for preceding base faces. This also stores the final + * ptex offset (the total number of PTex faces) at the end of the array + * so that algorithms can compute the number of ptex faces for a given + * face by computing the delta with the offset for the next face without + * using a separate data structure, e.g.: + * + * const int num_face_ptex_faces = face_ptex_offset[i + 1] - face_ptex_offset[i]; + * + * In total this array has a size of `num base faces + 1`. + */ int *face_ptex_offset; } cache_; } Subdiv; @@ -257,6 +266,9 @@ void BKE_subdiv_displacement_detach(Subdiv *subdiv); /* ============================ TOPOLOGY HELPERS ============================ */ +/* For each element in the array, this stores the total number of ptex faces up to that element, + * with the total number of ptex faces being the last element in the array. The array is of length + * `base face count + 1`. */ int *BKE_subdiv_face_ptex_offset_get(Subdiv *subdiv); /* =========================== PTEX FACES AND GRIDS ========================= */ |