diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-05 08:00:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-05 08:00:08 +0400 |
commit | e8346fa84c68005a508b290cf3d255f4004157f1 (patch) | |
tree | d4aa7490bae5fe9f2ebcd14b5581e6993f768ae6 /source/blender/modifiers | |
parent | 1ba71e2caf0f7e425eaefc24891a1752247ef6bd (diff) |
simplify get_vert2ob_distance, mat4_to_loc_rot_size isnt needed.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 6519d781f05..36f749ab506 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -169,25 +169,17 @@ static void get_vert2geom_distance(int numVerts, float (*v_cos)[3], * Note that it works in final world space (i.e. with constraints etc. applied). */ static void get_vert2ob_distance(int numVerts, float (*v_cos)[3], float *dist, - const Object* ob, const Object* obr) + Object* ob, Object* obr) { /* Vertex and ref object coordinates. */ - float v_wco[3], - or_wco[3], - or_wro[3][3], /*unused*/ - or_wsz[3]; /*unused*/ - int i; - - /* Get world-coordinates of the reference object (constraints and anim included). - * We also get rotation and scale, even though we do not want them… - */ - mat4_to_loc_rot_size(or_wco, or_wro, or_wsz, (float (*)[4])obr->obmat); + float v_wco[3]; + unsigned int i= numVerts; - for (i = 0; i < numVerts; i++) { + while(i-- > 0) { /* Get world-coordinates of the vertex (constraints and anim included). */ - mul_v3_m4v3(v_wco, (float (*)[4])ob->obmat, v_cos[i]); + mul_v3_m4v3(v_wco, ob->obmat, v_cos[i]); /* Return distance between both coordinates. */ - dist[i] = len_v3v3(v_wco, or_wco); + dist[i] = len_v3v3(v_wco, obr->obmat[3]); } } |