diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-11 14:17:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-11 14:17:06 +0400 |
commit | 94c9010e245a464012d2c0dcc14b6a7891565e58 (patch) | |
tree | 72eb6015a2ad7c7dbb7a40a9479175d18bbdfafa /source/blender/makesrna/intern | |
parent | 2c6a82dd0a9178efcaee0c3f8bbf3e5120a3dcaa (diff) |
make scene.ray_cast() behave like object.ray_cast(), add distance arg to snapObjectsRayEx().
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 207aaa4eb7a..a028be14cc7 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -96,11 +96,13 @@ static void rna_Scene_ray_cast(Scene *scene, ReportList *reports, float ray_star { float dummy_dist_px = 0; float ray_nor[3]; + float dist; sub_v3_v3v3(ray_nor, ray_end, ray_start); + dist = normalize_v3(ray_nor); if (snapObjectsRayEx(scene, NULL, NULL, NULL, NULL, SCE_SNAP_MODE_FACE, - ray_start, ray_nor, + ray_start, ray_nor, dist, NULL, &dummy_dist_px, r_location, r_normal, SNAP_ALL)) { *r_success = true; |