diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-20 13:37:24 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-20 16:39:41 +0300 |
commit | d511c7205675abdfbe83341aa6409af5d6dee625 (patch) | |
tree | ec2e6c8ca24a65a080458b125e403a25c5b3e052 /source/blender/blenkernel/BKE_subdiv_ccg.h | |
parent | 8196b9d7bcab5557f71a87c4bf334cc8ae099cd6 (diff) |
Subdiv: CCG, store edge adjacency information
This information is stored for each non-loose edge.
For each of such edge we store:
- List of CCG faces it is adjacent to.
This way we can easily check whether it is adjacent to
any face which is tagged for update or so.
- List of boundary elements from adjacent grids.
This allows to traverse along the edge and average all
adjacent grids.
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv_ccg.h')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv_ccg.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.h b/source/blender/blenkernel/BKE_subdiv_ccg.h index cbdc32e319b..f8dbd2092f1 100644 --- a/source/blender/blenkernel/BKE_subdiv_ccg.h +++ b/source/blender/blenkernel/BKE_subdiv_ccg.h @@ -68,6 +68,17 @@ typedef struct SubdivCCGFace { int start_grid_index; } SubdivCCGFace; +/* Definition of an edge which is adjacent to at least one of the faces. */ +typedef struct SubdivCCGAdjacentEdge { + int num_adjacent_faces; + /* Indexed by adjacent face index. */ + SubdivCCGFace **faces; + /* Indexed by adjacent face index, then by point index on the edge. + * points to a grid element. + */ + struct CCGElem ***boundary_elements; +} SubdivCCGAdjacentEdge; + /* Representation of subdivision surface which uses CCG grids. */ typedef struct SubdivCCG { /* This is a subdivision surface this CCG was created for. @@ -123,6 +134,12 @@ typedef struct SubdivCCG { /* Indexed by grid index, points to corresponding face from `faces`. */ SubdivCCGFace **grid_faces; + /* Edges which are adjacent to faces. + * Used for faster grid stitching, in the cost of extra memory. + */ + int num_adjacent_edges; + SubdivCCGAdjacentEdge *adjacent_edges; + struct DMFlagMat *grid_flag_mats; BLI_bitmap **grid_hidden; |