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>2016-01-12 11:37:56 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-01-12 12:09:00 +0300
commitc6c223ade6470e7a9b61ea4a4a3ab6ed62abe79d (patch)
treefb9323466d1c45ff6a99db96fc649fe3e6374249 /source/blender/editors/space_view3d/view3d_edit.c
parent90250f856817b68f29924be8a60152ec3a2486a8 (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/space_view3d/view3d_edit.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 6b98d2b9784..0f407658228 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -41,6 +41,7 @@
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
+#include "BLI_kdopbvh.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
@@ -5183,7 +5184,7 @@ bool ED_view3d_snap_from_ray(
float r_co[3])
{
float r_no_dummy[3];
- float ray_dist = TRANSFORM_DIST_MAX_RAY;
+ float ray_dist = BVH_RAYCAST_DIST_MAX;
bool ret;
struct Object *obedit = scene->obedit;
@@ -5223,7 +5224,7 @@ bool ED_view3d_snap_from_region(
float r_co[3], float r_no[3])
{
float r_no_dummy[3];
- float ray_dist = TRANSFORM_DIST_MAX_RAY;
+ float ray_dist = BVH_RAYCAST_DIST_MAX;
bool is_hit = false;
float *r_no_ptr = r_no ? r_no : r_no_dummy;
@@ -5236,7 +5237,7 @@ bool ED_view3d_snap_from_region(
for (int i = 0; i < 3; i++) {
if (elem_test[i] && (is_hit == false || use_depth)) {
if (use_depth == false) {
- ray_dist = TRANSFORM_DIST_MAX_RAY;
+ ray_dist = BVH_RAYCAST_DIST_MAX;
}
if (snapObjectsEx(
scene, v3d, ar, NULL, obedit,