diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-16 10:04:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-16 10:04:47 +0400 |
commit | 26b41bd0b527b91374c1884dd1d541fabc3f04b3 (patch) | |
tree | 7b5f9d17a4341f752768dfb9cf062c7ffb9a4b2b /source/blender/editors/space_view3d | |
parent | 666b65a8d0d8dd01c174009a4efc3c965cccba7c (diff) |
bugfix [#23841] Bone envelope draws funky
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 50798429801..c6aa4656191 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -655,6 +655,26 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], int boneflag mul_mat3_m4_v3(smat, dirvec); /* clear zcomp */ dirvec[2]= 0.0f; + + if(head != tail) { + /* correcyion when viewing along the bones axis + * it pops in and out but better then artifacts, [#23841] */ + float view_dist= len_v2(dirvec); + + if(head - view_dist > tail) { + tailvec= headvec; + tail = head; + zero_v3(dirvec); + dirvec[0]= 0.00001; // XXX. weak but ok + } + else if(tail - view_dist > head) { + headvec= tailvec; + head = tail; + zero_v3(dirvec); + dirvec[0]= 0.00001; // XXX. weak but ok + } + } + /* move vector back */ mul_mat3_m4_v3(imat, dirvec); |