From 7dec7094dac73709f3bfa4980a94da98c50d3fb2 Mon Sep 17 00:00:00 2001 From: Zi Ree Date: Thu, 21 Dec 2023 17:03:38 +0100 Subject: [PATCH] Fix not being able to rez a box on top of a prim when MaxSelectDistance is shorter than the surface distance, even though LimitSelectDistance is switched off. --- indra/newview/lltoolplacer.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 5943d7de1f..dc573ce2d7 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -200,7 +200,16 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, } else { - LLVector3d ray_end_global = ray_start_global + (1.f + max_dist_from_camera) * mouse_direction; // add an epsilon to the sim version of the ray to avoid rounding problems. + // Fix not being able to rez a box on top of a prim when MaxSelectDistance is shorter + // than the surface distance, even though LimitSelectDistance is switched off. + // LLVector3d ray_end_global = ray_start_global + (1.f + max_dist_from_camera) * mouse_direction; // add an epsilon to the sim version of the ray to avoid rounding problems. + F32 max_raycast_dist = 129.0f; + if (limitSelectDistance) + { + max_raycast_dist = max_dist_from_camera; + } + LLVector3d ray_end_global = ray_start_global + max_raycast_dist * mouse_direction; // add an epsilon to the sim version of the ray to avoid rounding problems. + // *ray_end_region = regionp->getPosRegionFromGlobal( ray_end_global ); }