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:
authorCampbell Barton <ideasman42@gmail.com>2011-12-29 10:07:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-29 10:07:34 +0400
commitc058d252d1c5a1a12913ff036f1e7832115c8e3b (patch)
treeb0c5d4060b3dabf2ebaf6ced38cf5d2c017e3fb0 /source/blender/modifiers/intern/MOD_mirror.c
parentb4c95833aba19750364c2ba1d442fc0fa80dc7ab (diff)
minor edits to trunk mirror modifier, use unsigned ints since the vertex values are unsigned + minor formatting edits
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mirror.c')
-rw-r--r--source/blender/modifiers/intern/MOD_mirror.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c
index 8a003256ff2..dc38dcba9d4 100644
--- a/source/blender/modifiers/intern/MOD_mirror.c
+++ b/source/blender/modifiers/intern/MOD_mirror.c
@@ -95,10 +95,10 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
}
static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
- Object *ob,
- DerivedMesh *dm,
- int initFlags,
- int axis)
+ Object *ob,
+ DerivedMesh *dm,
+ int initFlags,
+ int axis)
{
int i;
float tolerance = mmd->tolerance;
@@ -109,7 +109,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
int maxFaces = dm->getNumFaces(dm);
int *flip_map= NULL, flip_map_len= 0;
int do_vgroup_mirr= (mmd->flag & MOD_MIR_VGROUP);
- int (*indexMap)[2];
+ unsigned int (*indexMap)[2];
float mtx[4][4], imtx[4][4];
numVerts = numEdges = numFaces = 0;
@@ -153,25 +153,27 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
isShared = ABS(co[axis])<=tolerance;
/* Because the topology result (# of vertices) must be the same if
- * the mesh data is overridden by vertex cos, have to calc sharedness
- * based on original coordinates. This is why we test before copy.
- */
+ * the mesh data is overridden by vertex cos, have to calc sharedness
+ * based on original coordinates. This is why we test before copy.
+ */
DM_copy_vert_data(dm, result, i, numVerts, 1);
*mv = inMV;
- numVerts++;
-
- indexMap[i][0] = numVerts - 1;
+
+ indexMap[i][0] = numVerts;
indexMap[i][1] = !isShared;
- //
+
+ numVerts++;
+
if(isShared ) {
- co[axis] = 0;
+ co[axis] = 0.0f;
if (mmd->mirror_ob) {
mul_m4_v3(imtx, co);
}
copy_v3_v3(mv->co, co);
mv->flag |= ME_VERT_MERGED;
- } else {
+ }
+ else {
MVert *mv2 = CDDM_get_vert(result, numVerts);
DM_copy_vert_data(dm, result, i, numVerts, 1);
@@ -236,10 +238,11 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
mf->v3 = indexMap[inMF.v3][0];
mf->v4 = indexMap[inMF.v4][0];
- if(indexMap[inMF.v1][1]
- || indexMap[inMF.v2][1]
- || indexMap[inMF.v3][1]
- || (mf->v4 && indexMap[inMF.v4][1])) {
+ if ( indexMap[inMF.v1][1] ||
+ indexMap[inMF.v2][1] ||
+ indexMap[inMF.v3][1] ||
+ (mf->v4 && indexMap[inMF.v4][1]))
+ {
MFace *mf2 = CDDM_get_face(result, numFaces);
static int corner_indices[4] = {2, 1, 0, 3};