Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-11 14:17:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-11 14:17:06 +0400
commit94c9010e245a464012d2c0dcc14b6a7891565e58 (patch)
tree72eb6015a2ad7c7dbb7a40a9479175d18bbdfafa /source/blender/makesrna/intern/rna_scene_api.c
parent2c6a82dd0a9178efcaee0c3f8bbf3e5120a3dcaa (diff)
make scene.ray_cast() behave like object.ray_cast(), add distance arg to snapObjectsRayEx().
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c4
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;