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>2012-05-13 15:05:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-13 15:05:52 +0400
commit305d341ec2c2c5c6485ad6cd719e9472e4bb460d (patch)
treefa4c658ad417869a0ed2e7ef5f37ca94adb2cc3b /source/blender/editors/mesh
parent13bbf1cc7b0a620173475172278d2f8eb9593ccd (diff)
code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editface.c2
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c2
-rw-r--r--source/blender/editors/mesh/meshtools.c14
3 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 5f6384d6b24..63704f5b8e6 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -427,7 +427,7 @@ int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
copy_v3_v3(vec, (mvert[ml->v].co));
mul_m3_v3(bmat, vec);
add_v3_v3v3(vec, vec, ob->obmat[3]);
- DO_MINMAX(vec, r_min, r_max);
+ minmax_v3v3_v3(r_min, r_max, vec);
}
ok = TRUE;
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 2f317ed87c2..9be71218da0 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -734,7 +734,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent
BM_ITER_MESH (v1, &iter, vc.em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(v1, BM_ELEM_SELECT)) {
- DO_MINMAX(v1->co, min, max);
+ minmax_v3v3_v3(min, max, v1->co);
done = 1;
}
}
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index aa89eaa0c6d..989f1a36f99 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -806,7 +806,7 @@ intptr_t mesh_octree_table(Object *ob, BMEditMesh *em, const float co[3], char m
BMVert *eve;
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
- DO_MINMAX(eve->co, min, max);
+ minmax_v3v3_v3(min, max, eve->co);
}
}
else {
@@ -814,19 +814,17 @@ intptr_t mesh_octree_table(Object *ob, BMEditMesh *em, const float co[3], char m
int a;
for (a = 0, mvert = me->mvert; a < me->totvert; a++, mvert++)
- DO_MINMAX(mvert->co, min, max);
+ minmax_v3v3_v3(min, max, mvert->co);
}
/* for quick unit coordinate calculus */
copy_v3_v3(MeshOctree.offs, min);
- MeshOctree.offs[0] -= MOC_THRESH; /* we offset it 1 threshold unit extra */
- MeshOctree.offs[1] -= MOC_THRESH;
- MeshOctree.offs[2] -= MOC_THRESH;
+ /* we offset it 1 threshold unit extra */
+ add_v3_fl(MeshOctree.offs, -MOC_THRESH);
sub_v3_v3v3(MeshOctree.div, max, min);
- MeshOctree.div[0] += 2 * MOC_THRESH; /* and divide with 2 threshold unit more extra (try 8x8 unit grid on paint) */
- MeshOctree.div[1] += 2 * MOC_THRESH;
- MeshOctree.div[2] += 2 * MOC_THRESH;
+ /* and divide with 2 threshold unit more extra (try 8x8 unit grid on paint) */
+ add_v3_fl(MeshOctree.div, 2.0f * MOC_THRESH);
mul_v3_fl(MeshOctree.div, 1.0f / MOC_RES);
if (MeshOctree.div[0] == 0.0f) MeshOctree.div[0] = 1.0f;