diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-16 20:36:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-16 20:55:14 +0300 |
commit | 595a491e63d6f3f3462675d38cfa71b4e784fe9c (patch) | |
tree | df32ec17691b9280d7b2fa675cd5e5a0f87ea849 /source/blender/makesdna/DNA_meshdata_types.h | |
parent | c8f6313487dfbbee030c6796220cc0d91228d658 (diff) |
Add tessellation data to DerivedMesh (LoopTri)
This stores loop indices into the loop array giving easier acess
to data such as vertex-colors and UV's,
removing the need to store an MFace duplicate of custom-data.
This doesn't yet move all internal code from MFace to LoopTri just yet.
Only applies to:
- opengl drawing
- sculpting (pbvh)
- vertex/weight paint
Thanks to @psy-fi for review, fixes and improvements to drawing!
Diffstat (limited to 'source/blender/makesdna/DNA_meshdata_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index b76f40c884d..12c6e0ec0a5 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -89,6 +89,14 @@ typedef struct MLoop { unsigned int e; /* edge index */ } MLoop; +/* runtime only */ +# +# +typedef struct MLoopTri { + unsigned int tri[3]; + unsigned int poly; +} MLoopTri; + typedef struct MTexPoly { struct Image *tpage; char flag, transp; @@ -345,6 +353,9 @@ enum { #define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)]) #define ME_POLY_LOOP_NEXT(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)]) +/* number of tri's that make up this polygon once tessellated */ +#define ME_POLY_TRI_TOT(mp) ((mp)->totloop - 2) + /* mselect->type */ enum { ME_VSEL = 0, |