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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-07-25 22:12:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-07-25 22:12:04 +0300
commit9c0dea213ed55b7a66d454bf16de8a7d6855a596 (patch)
tree6891cae09e61eb6f6d6c57eed85aa51722b3f6bb /source/blender/makesrna/intern/rna_object_api.c
parent8c9e6c59863077512e7abfa4fdedbbedfd954a87 (diff)
parent29d1db9ed6253f68c5452be1f0125ed364d4a954 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/blenkernel/intern/rigidbody.c
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 8f8f3176096..3adf9f790d9 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -333,8 +333,10 @@ static void rna_Object_ray_cast(
/* Test BoundBox first (efficiency) */
BoundBox *bb = BKE_object_boundbox_get(ob);
float distmin;
- if (!bb || (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) && distmin <= distance)) {
-
+ normalize_v3(direction); /* Needed for valid distance check from isect_ray_aabb_v3_simple() call. */
+ if (!bb ||
+ (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) && distmin <= distance))
+ {
BVHTreeFromMesh treeData = {NULL};
/* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
@@ -347,9 +349,6 @@ static void rna_Object_ray_cast(
hit.index = -1;
hit.dist = distance;
- normalize_v3(direction);
-
-
if (BLI_bvhtree_ray_cast(treeData.tree, origin, direction, 0.0f, &hit,
treeData.raycast_callback, &treeData) != -1)
{