diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-30 04:08:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-30 04:08:33 +0400 |
commit | 1f58bfb8bebf207d3020ff474ac5e018c8179f25 (patch) | |
tree | cf365a66923b4a03bcfbf6ef43d07ccf6309a19e /source/blender/editors/armature/reeb.c | |
parent | 23ef10c705a21d86e06f64d7af06fddbd9a42928 (diff) |
Code cleanup: de-duplicate cotangent weight function & add arg sizes
Diffstat (limited to 'source/blender/editors/armature/reeb.c')
-rw-r--r-- | source/blender/editors/armature/reeb.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index d521de54576..e36b5c808dc 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2497,32 +2497,16 @@ int weightFromLoc(EditMesh *em, int axis) return 1; } -static float cotan_weight(float *v1, float *v2, float *v3) -{ - float a[3], b[3], c[3], clen; - - sub_v3_v3v3(a, v2, v1); - sub_v3_v3v3(b, v3, v1); - cross_v3_v3v3(c, a, b); - - clen = len_v3(c); - - if (clen == 0.0f) - return 0.0f; - - return dot_v3v3(a, b) / clen; -} - static void addTriangle(EditVert *v1, EditVert *v2, EditVert *v3, int e1, int e2, int e3) { /* Angle opposite e1 */ - float t1 = cotan_weight(v1->co, v2->co, v3->co) / e2; + float t1 = cotangent_tri_weight_v3(v1->co, v2->co, v3->co) / e2; /* Angle opposite e2 */ - float t2 = cotan_weight(v2->co, v3->co, v1->co) / e3; + float t2 = cotangent_tri_weight_v3(v2->co, v3->co, v1->co) / e3; /* Angle opposite e3 */ - float t3 = cotan_weight(v3->co, v1->co, v2->co) / e1; + float t3 = cotangent_tri_weight_v3(v3->co, v1->co, v2->co) / e1; int i1 = indexData(v1); int i2 = indexData(v2); |