diff options
Diffstat (limited to 'source/blender/blenlib/intern/BLI_kdopbvh.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index d6d0443893e..1b9b6e38208 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1650,6 +1650,8 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f BVHRayCastData data; BVHNode *root = tree->nodes[tree->totleaf]; + BLI_ASSERT_UNIT_V3(dir); + data.tree = tree; data.callback = callback; @@ -1659,8 +1661,6 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], f copy_v3_v3(data.ray.direction, dir); data.ray.radius = radius; - normalize_v3(data.ray.direction); - bvhtree_ray_cast_data_precalc(&data); if (hit) @@ -1713,6 +1713,8 @@ int BLI_bvhtree_ray_cast_all(BVHTree *tree, const float co[3], const float dir[3 BVHRayCastData data; BVHNode *root = tree->nodes[tree->totleaf]; + BLI_ASSERT_UNIT_V3(dir); + data.tree = tree; data.callback = callback; @@ -1722,8 +1724,6 @@ int BLI_bvhtree_ray_cast_all(BVHTree *tree, const float co[3], const float dir[3 copy_v3_v3(data.ray.direction, dir); data.ray.radius = radius; - normalize_v3(data.ray.direction); - bvhtree_ray_cast_data_precalc(&data); data.hit.index = -1; |