diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-07 05:06:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-07 05:06:18 +0400 |
commit | f11d7a426f4ceaa914c76a120d4e420308801f3b (patch) | |
tree | 33d62f8065548503c169b9aa4fa42f4141dbc3dc /source/blender/editors/space_view3d/view3d_view.c | |
parent | 400a0297b0b10dbed6a4f5fe8fddd9cdc58914af (diff) |
fix for bug in ED_view3d_project_float that only effected the 'Rip' tool.
when the source and destination vectors were the same pointer, the X value would get overwritten.
now the rip tool uses the best side to grab as in trunk.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 359bb8967eb..7a7a7e9920e 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -770,18 +770,18 @@ void view3d_unproject(bglMats *mats, float out[3], const short x, const short y, } /* use view3d_get_object_project_mat to get projecting mat */ -void ED_view3d_project_float(const ARegion *ar, const float vec[3], float adr[2], float mat[4][4]) +void ED_view3d_project_float_v2(const ARegion *ar, const float vec[3], float adr[2], float mat[4][4]) { float vec4[4]; - adr[0]= IS_CLIPPED; copy_v3_v3(vec4, vec); vec4[3]= 1.0; + /* adr[0]= IS_CLIPPED; */ /* always overwritten */ mul_m4_v4(mat, vec4); - if ( vec4[3]>FLT_EPSILON ) { - adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3]; + if (vec4[3] > FLT_EPSILON) { + adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3]; adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3]; } else { @@ -790,17 +790,17 @@ void ED_view3d_project_float(const ARegion *ar, const float vec[3], float adr[2] } /* use view3d_get_object_project_mat to get projecting mat */ -void ED_view3d_project_float_v3(ARegion *ar, const float vec[3], float *adr, float mat[4][4]) +void ED_view3d_project_float_v3(ARegion *ar, const float vec[3], float adr[3], float mat[4][4]) { float vec4[4]; copy_v3_v3(vec4, vec); vec4[3]= 1.0; - adr[0]= IS_CLIPPED; + /* adr[0]= IS_CLIPPED; */ /* always overwritten */ mul_m4_v4(mat, vec4); - if ( vec4[3]>FLT_EPSILON ) { + if (vec4[3] > FLT_EPSILON) { adr[0] = (float)(ar->winx/2.0f)+(ar->winx/2.0f)*vec4[0]/vec4[3]; adr[1] = (float)(ar->winy/2.0f)+(ar->winy/2.0f)*vec4[1]/vec4[3]; adr[2] = vec4[2]/vec4[3]; |