diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-12 11:37:56 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-12 12:09:00 +0300 |
commit | c6c223ade6470e7a9b61ea4a4a3ab6ed62abe79d (patch) | |
tree | fb9323466d1c45ff6a99db96fc649fe3e6374249 /source/blender/editors/transform | |
parent | 90250f856817b68f29924be8a60152ec3a2486a8 (diff) |
Fix T47164: [Scene.raycast] - True result when it should be False.
We cannot use FLT_MAX as initi distance for raycast...
Renamed TRANSFORM_DIST_MAX_RAY to BVH_RAYCAST_DIST_MAX, moved it into BLI_kdopbvh,
and use in RNA raycast callbacks (and all other places using that API).
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 359e191c90d..869f03e416a 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1544,7 +1544,7 @@ static bool snapDerivedMesh( if (totvert > 0) { float imat[4][4]; float timat[3][3]; /* transpose inverse matrix for normals */ - float ray_start_local[3], ray_normal_local[3], local_scale, len_diff = TRANSFORM_DIST_MAX_RAY; + float ray_start_local[3], ray_normal_local[3], local_scale, len_diff = BVH_RAYCAST_DIST_MAX; invert_m4_m4(imat, obmat); transpose_m3_m4(timat, imat); @@ -1637,7 +1637,7 @@ static bool snapDerivedMesh( hit.index = -1; hit.dist = *ray_depth; - if (hit.dist != TRANSFORM_DIST_MAX_RAY) { + if (hit.dist != BVH_RAYCAST_DIST_MAX) { hit.dist *= local_scale; hit.dist -= len_diff; } @@ -2081,7 +2081,7 @@ bool snapObjectsTransform( TransInfo *t, const float mval[2], SnapSelect snap_select, float r_loc[3], float r_no[3], float *r_dist_px) { - float ray_dist = TRANSFORM_DIST_MAX_RAY; + float ray_dist = BVH_RAYCAST_DIST_MAX; Object *obedit = NULL; Base *base_act = NULL; @@ -2109,7 +2109,7 @@ bool snapObjectsContext( Scene *scene = CTX_data_scene(C); ARegion *ar = CTX_wm_region(C); Object *obedit = CTX_data_edit_object(C); - float ray_dist = TRANSFORM_DIST_MAX_RAY; + float ray_dist = BVH_RAYCAST_DIST_MAX; return snapObjects( scene, v3d, ar, scene->basact, obedit, |