Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-05-11 00:32:41 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-05-11 00:32:41 +0400
commitdcacbc25bc0fb850b56673f7f167aa623d1e2fb5 (patch)
tree2c6ab5c0f2aebab09cdcf373823225b7849be6b0 /source/blender/blenkernel/intern/CCGSubSurf.h
parent147b4b13ba3bacc02956d4678b14916ee5cdce53 (diff)
Modify CCGSubsurf to subdivide an arbitrary number of (float) layers.
The layout of vert data in CCGSubSurf is almost the same; previously it was three floats (for xyz coordinate) optionally followed by three floats for the normal. The only change is that the first three floats can now be any number of floats. * _getSubSurf takes a numLayers parameter to set the number of layers, stored in CCGMeshIFC.numLayers. * All calls to _getSubSurf currently have numLayers set to 3, except for UV subsurf, where it is reduced to 2 (with a corresponding change when reading the results out to use float (*)[2] rather than float (*)[3].) * The various VertData* macros in CCGSubSurf.c are now functions that take a CCGSubSurf pointer, which provides access to CCGMeshIFC, which has numLayers. * Add ccgSubSurf_setNumLayers() to the API. Only changes the number of layers that get subdivided, doesn't change the amount of memory allocated. So if space for N layers is allocated, it's safe to set the number of layers to less than N, but not more. * The rest of the changes are just adding the 'ss' parameter.
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.h')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.h b/source/blender/blenkernel/intern/CCGSubSurf.h
index e73ef6b543e..76e1911b0a5 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.h
+++ b/source/blender/blenkernel/intern/CCGSubSurf.h
@@ -15,7 +15,7 @@ typedef struct CCGFace CCGFace;
typedef struct CCGMeshIFC {
int vertUserSize, edgeUserSize, faceUserSize;
-
+ int numLayers;
int vertDataSize;
} CCGMeshIFC;
@@ -77,6 +77,8 @@ CCGError ccgSubSurf_setUseAgeCounts (CCGSubSurf *ss, int useAgeCounts, int ver
CCGError ccgSubSurf_setCalcVertexNormals (CCGSubSurf *ss, int useVertNormals, int normalDataOffset);
+void ccgSubSurf_setNumLayers (CCGSubSurf *ss, int numLayers);
+
/***/
int ccgSubSurf_getNumVerts (const CCGSubSurf *ss);