diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-12 09:19:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-12 09:19:20 +0300 |
commit | 1813f00b94982727bf545cd4c49ec2d2fee86f7a (patch) | |
tree | 924c90d42cdf75530c45aff3e30f36a146436d37 /source/blender/editors/transform | |
parent | be8add5d505b14fcdc5d2caf6dc4bb345f057a7c (diff) |
Fix missing fallback in recent aabb precalc func
Also comment unused vars
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 5ef2ce479e7..ed7ada26bd7 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -1432,6 +1432,8 @@ static bool snapMesh( /* return args */ float r_loc[3], float r_no[3]) { +// #define USE_RAY_MIN + bool retval = false; if (snapdata->snap_to == SCE_SNAP_MODE_EDGE) { @@ -1448,7 +1450,7 @@ static bool snapMesh( float imat[4][4]; float timat[3][3]; /* transpose inverse matrix for normals */ float ray_normal_local[3]; - float local_scale; + invert_m4_m4(imat, obmat); transpose_m3_m4(timat, imat); @@ -1457,16 +1459,18 @@ static bool snapMesh( mul_mat3_m4_v3(imat, ray_normal_local); +#ifdef USE_RAY_MIN /* local scale in normal direction */ - local_scale = normalize_v3(ray_normal_local); + const float local_scale = normalize_v3(ray_normal_local); +#endif float lpmat[4][4]; float ray_org_local[3]; - float ray_min_dist; mul_m4_m4m4(lpmat, snapdata->pmat, obmat); - ray_min_dist = snapdata->depth_range[0] * local_scale; - +#ifdef USE_RAY_MIN + const float ray_min_dist = snapdata->depth_range[0] * local_scale; +#endif copy_v3_v3(ray_org_local, snapdata->ray_origin); mul_m4_v3(imat, ray_org_local); |