diff options
author | Andrew Meadows <andrew@lindenlab.com> | 2011-01-07 15:22:33 -0800 |
---|---|---|
committer | Andrew Meadows <andrew@lindenlab.com> | 2011-01-07 15:22:33 -0800 |
commit | 1b7bd5e2d0d8f3c8f31c037aae8f46b1377178fd (patch) | |
tree | f4a4d2bd79cda3b8c4f787d7cedd92bd7358c70b /indra/newview/llviewerparceloverlay.cpp | |
parent | d23f7df822b6c0557f9426b5e1aa660b77aba01e (diff) | |
parent | d12b7b347ad4094b96ba2a650ae86dfb9db2a893 (diff) |
merge
Diffstat (limited to 'indra/newview/llviewerparceloverlay.cpp')
-rw-r--r-- | indra/newview/llviewerparceloverlay.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 58d9009c90..1207ef3340 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -145,27 +145,28 @@ BOOL LLViewerParcelOverlay::isOwnedOther(const LLVector3& pos) const return (PARCEL_OWNED == overlay || PARCEL_FOR_SALE == overlay); } -bool LLViewerParcelOverlay::encroachesOwned(const LLBBox& bbox) const +bool LLViewerParcelOverlay::encroachesOwned(const std::vector<LLBBox>& boxes) const { - LLBBox bbox_aligned = bbox.getAxisAligned(); - - LLVector3 min = bbox_aligned.getMinAgent(); - LLVector3 max = bbox_aligned.getMaxAgent(); + // 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)); - 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 - || PARCEL_GROUP == type ) - return true; - } - + for (S32 row = top; row <= bottom; row++) + for (S32 column = left; column <= right; column++) + { + U8 type = ownership(row, column); + if (PARCEL_SELF == type + || PARCEL_GROUP == type ) + return true; + } + } return false; } |