Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to know land boundaries?

Monica Balut
Beam-Me
Join date: 18 Feb 2007
Posts: 311
05-14-2007 19:58
I'm trying to write a script which uses llRezAtRoot to rez and object ( building) on my land. I want to make sure that where I rez it, it will be entirely on my land. Will llOverMyLand give me what I want if only part of the object is off my land?
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
05-15-2007 12:41
The llOverMyLand call will most likey only give you whither the center is over your land.
Milambus Oh
Registered User
Join date: 6 Apr 2007
Posts: 224
05-15-2007 13:23
This is not debugged in any way...

CODE

function isObjectOverOtherProperty() {
vector size =llGetScale();
float width = size.x;
float length = size.y;
float height = size.z;

vector pos = llGetPos();
key owner = llGetOwner();

vector toCheck;

// Left, Back, Top corner
toCheck = pos + <width / 2, length / 2, height / 2>;
if (owner != llGetLandOwnerAt(toCheck)) return true;

// Right, Front, Bottom corner
toCheck = pos + <-1 * width / 2,-1 * height / 2,-1 * length / 2>;
if (owner != llGetLandOwnerAt(toCheck)) return true;

// Repeat for other 6 corners

return false;
}


I think that should work at least... The math may be wrong though, but that should give you an idea.