diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-02-06 08:08:34 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-02-06 08:08:34 +0300 |
commit | 38a7416a66433fe001b0a6ca2941141e691944d8 (patch) | |
tree | 1732fd29a267b95fa495e2f96b30fa8d586d3982 /mesh_snap_utilities_line | |
parent | f40ec5d6a4e7ca3aa39debc1ca32518250d21e57 (diff) |
mesh_snap_utilities_line: Fix failed object detection in orthographic view
Diffstat (limited to 'mesh_snap_utilities_line')
-rw-r--r-- | mesh_snap_utilities_line/snap_context_l/utils_projection.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mesh_snap_utilities_line/snap_context_l/utils_projection.py b/mesh_snap_utilities_line/snap_context_l/utils_projection.py index cc17aa23..a9b0f021 100644 --- a/mesh_snap_utilities_line/snap_context_l/utils_projection.py +++ b/mesh_snap_utilities_line/snap_context_l/utils_projection.py @@ -97,19 +97,22 @@ def intersect_boundbox_threshold(sctx, MVP, ray_origin_local, ray_direction_loca tmin[0] = (local_bvmin[0] - ray_origin_local[0]) / ray_direction_local[0] tmax[0] = (local_bvmax[0] - ray_origin_local[0]) / ray_direction_local[0] else: - tmin[0] = tmax[0] = sctx.depth_range[1] + tmin[0] = sctx.depth_range[0] + tmax[0] = sctx.depth_range[1] if (ray_direction_local[1]): tmin[1] = (local_bvmin[1] - ray_origin_local[1]) / ray_direction_local[1] tmax[1] = (local_bvmax[1] - ray_origin_local[1]) / ray_direction_local[1] else: - tmin[1] = tmax[1] = sctx.depth_range[1] + tmin[1] = sctx.depth_range[0] + tmax[1] = sctx.depth_range[1] if (ray_direction_local[2]): tmin[2] = (local_bvmin[2] - ray_origin_local[2]) / ray_direction_local[2] tmax[2] = (local_bvmax[2] - ray_origin_local[2]) / ray_direction_local[2] else: - tmin[2] = tmax[2] = sctx.depth_range[1] + tmin[2] = sctx.depth_range[0] + tmax[2] = sctx.depth_range[1] # `va` and `vb` are the coordinates of the AABB edge closest to the ray # va = Vector() @@ -133,12 +136,10 @@ def intersect_boundbox_threshold(sctx, MVP, ray_origin_local, ray_direction_loca rtmin = tmin[0] va[0] = vb[0] = local_bvmin[0] main_axis -= 3 - elif ((tmin[1] >= tmin[0]) and (tmin[1] >= tmin[2])): rtmin = tmin[1] va[1] = vb[1] = local_bvmin[1] main_axis -= 1 - else: rtmin = tmin[2] va[2] = vb[2] = local_bvmin[2] |