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-12-21 09:07:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-21 09:07:26 +0400
commitb2c66e268f68ee406e5e05a65d9d1609b65d20c4 (patch)
tree722192b9fe1d7af57695860fc3639781bedf5f2b /source/blender/blenkernel/intern/mball.c
parente09ddf0d4ba6f6d1e8963d41eef153dadce482f8 (diff)
replace MIN/MAX 3,4 with inline functions
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r--source/blender/blenkernel/intern/mball.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 5c882fd97d6..b3f71e58e9f 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -1514,7 +1514,7 @@ static void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
float in_v /*, out_v*/;
float workp[3];
float dvec[3];
- float tmp_v, workp_v, max_len, len, nx, ny, nz, MAXN;
+ float tmp_v, workp_v, max_len, nx, ny, nz, max_dim;
calc_mballco(ml, in);
in_v = mbproc->function(in[0], in[1], in[2]);
@@ -1573,17 +1573,17 @@ static void find_first_points(PROCESS *mbproc, MetaBall *mb, int a)
ny = abs((out[1] - in[1]) / mbproc->size);
nz = abs((out[2] - in[2]) / mbproc->size);
- MAXN = MAX3(nx, ny, nz);
- if (MAXN != 0.0f) {
- dvec[0] = (out[0] - in[0]) / MAXN;
- dvec[1] = (out[1] - in[1]) / MAXN;
- dvec[2] = (out[2] - in[2]) / MAXN;
+ max_dim = max_fff(nx, ny, nz);
+ if (max_dim != 0.0f) {
+ float len = 0.0f;
+
+ dvec[0] = (out[0] - in[0]) / max_dim;
+ dvec[1] = (out[1] - in[1]) / max_dim;
+ dvec[2] = (out[2] - in[2]) / max_dim;
- len = 0.0;
while (len <= max_len) {
- workp[0] += dvec[0];
- workp[1] += dvec[1];
- workp[2] += dvec[2];
+ add_v3_v3(workp, dvec);
+
/* compute value of implicite function */
tmp_v = mbproc->function(workp[0], workp[1], workp[2]);
/* add cube to the stack, when value of implicite function crosses zero value */