diff options
author | Oz Linden <oz@lindenlab.com> | 2011-08-04 09:12:08 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-08-04 09:12:08 -0400 |
commit | ca3cea390ca44e6e6c390b390e0ebdfafd2afa9e (patch) | |
tree | 005b934f87b6c5adc0a6f84ef6f12c67d606ce37 /indra/newview/llviewerparceloverlay.cpp | |
parent | 1d9fe077a64d36272b32ae0fb1888d2b25aa1d43 (diff) | |
parent | 5451af6cca43f296e1b5654ab3e611928929c1c9 (diff) |
merge changes for storm-1537 : releasable mesh branch
Diffstat (limited to 'indra/newview/llviewerparceloverlay.cpp')
-rw-r--r-- | indra/newview/llviewerparceloverlay.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 26765bdd01..eff16b6a6e 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -173,6 +173,33 @@ bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) co } return false; } +bool LLViewerParcelOverlay::encroachesOnUnowned(const std::vector<LLBBox>& boxes) const +{ + // boxes are expected to already be axis aligned + for (U32 i = 0; i < boxes.size(); ++i) + { + LLVector3 min = boxes[i].getMinAgent(); + LLVector3 max = boxes[i].getMaxAgent(); + + S32 left = S32(llclamp((min.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1)); + S32 right = S32(llclamp((max.mV[VX] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1)); + S32 top = S32(llclamp((min.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1)); + S32 bottom = S32(llclamp((max.mV[VY] / PARCEL_GRID_STEP_METERS), 0.f, REGION_WIDTH_METERS - 1)); + + for (S32 row = top; row <= bottom; row++) + { + for (S32 column = left; column <= right; column++) + { + U8 type = ownership(row, column); + if ((PARCEL_SELF != type)) + { + return true; + } + } + } + } + return false; +} BOOL LLViewerParcelOverlay::isSoundLocal(const LLVector3& pos) const { |