diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llworld.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp index 66c4068..4dee103 100644 --- a/linden/indra/newview/llworld.cpp +++ b/linden/indra/newview/llworld.cpp | |||
@@ -365,9 +365,14 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe | |||
365 | clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY]; | 365 | clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY]; |
366 | } | 366 | } |
367 | 367 | ||
368 | // clamp to < 256 to stay in sim | 368 | // clamp to within region dimensions |
369 | LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); | 369 | LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); |
370 | final_region_pos.clamp(0.0, 255.999); | 370 | final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], 0.0, |
371 | (F64)(region_width - F_ALMOST_ZERO)); | ||
372 | final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0, | ||
373 | (F64)(region_width - F_ALMOST_ZERO)); | ||
374 | final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0, | ||
375 | (F64)(LLWorld::getInstance()->getRegionMaxHeight())); | ||
371 | return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos)); | 376 | return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos)); |
372 | } | 377 | } |
373 | 378 | ||