diff options
author | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2012-11-12 16:30:02 +0400 |
---|---|---|
committer | Jason Wilkins <Jason.A.Wilkins@gmail.com> | 2012-11-12 16:30:02 +0400 |
commit | 6b65102c20e9bdafd90f55f60c2a2084d873e809 (patch) | |
tree | a0f5554702501d2da1073b22ff55f740aff135f9 /source/blender/bmesh/intern/bmesh_interp.c | |
parent | 053710fcbc78ff83b9617be87558876e381f85a6 (diff) | |
parent | 83de5cb30831328548502126dff84ffdb72544f2 (diff) |
Merge w/ trunk: r51141-52085 (Important Note: gameengine and blenderplayer were not merged due to complex differences)
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_interp.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_interp.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index 12fcd51c069..508b3b8fcdf 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -224,10 +224,8 @@ static int compute_mdisp_quad(BMLoop *l, float v1[3], float v2[3], float v3[3], /* computer center */ BM_face_calc_center_mean(l->f, cent); - add_v3_v3v3(p, l->prev->v->co, l->v->co); - mul_v3_fl(p, 0.5); - add_v3_v3v3(n, l->next->v->co, l->v->co); - mul_v3_fl(n, 0.5); + mid_v3_v3v3(p, l->prev->v->co, l->v->co); + mid_v3_v3v3(n, l->next->v->co, l->v->co); copy_v3_v3(v1, cent); copy_v3_v3(v2, p); @@ -257,7 +255,7 @@ static float quad_coord(float aa[3], float bb[3], float cc[3], float dd[3], int f1 = fabsf(f1); f2 = fabsf(f2); - f1 = minf(f1, f2); + f1 = min_ff(f1, f2); CLAMP(f1, 0.0f, 1.0f + FLT_EPSILON); } else { @@ -345,9 +343,9 @@ static int mdisp_in_mdispquad(BMLoop *l, BMLoop *tl, float p[3], float *x, float float v1[3], v2[3], c[3], v3[3], v4[3], e1[3], e2[3]; float eps = FLT_EPSILON * 4000; - if (len_v3(l->v->no) == 0.0f) + if (is_zero_v3(l->v->no)) BM_vert_normal_update_all(l->v); - if (len_v3(tl->v->no) == 0.0f) + if (is_zero_v3(tl->v->no)) BM_vert_normal_update_all(tl->v); compute_mdisp_quad(tl, v1, v2, v3, v4, e1, e2); @@ -490,7 +488,7 @@ static void bm_loop_interp_mdisps(BMesh *bm, BMLoop *target, BMFace *source) } /** - * smoothes boundaries between multires grids, + * smooths boundaries between multires grids, * including some borders in adjacent faces */ void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f) @@ -525,8 +523,7 @@ void BM_face_multires_bounds_smooth(BMesh *bm, BMFace *f) sides = (int)sqrt(mdp->totdisp); for (y = 0; y < sides; y++) { - add_v3_v3v3(co1, mdn->disps[y * sides], mdl->disps[y]); - mul_v3_fl(co1, 0.5); + mid_v3_v3v3(co1, mdn->disps[y * sides], mdl->disps[y]); copy_v3_v3(mdn->disps[y * sides], co1); copy_v3_v3(mdl->disps[y], co1); |