|
|
On 8/5/2013 4:35 AM, scott wrote:
>>> Thus, only testing "one" box, and only on that single plane.
>>>
>>> Then again, I screwed up the last idea so badly... lol
>>
>> And, speaking of which.. again, I forget that the "distance" won't work
>> for objects wider, or taller, than the distance... Sigh...
>
> Make your bounding box the value of "distance" bigger than the bounding
> box of the object's geometry. That way you are checking for people
> within "distance" from the *edge* of the object, not from the centre.
Only, then it detecting them too far away, when standing directly in
front of it. If I want someone to be able to open a door from 5 meters,
it should be 5 meters, regardless of where they are, when they do it.
Or, in the specific case that led me to hunt for a solution, they can't
be a) on the wrong side of a counter, b) farther than 3 meters from the
safe, c) outside the building (i.e., behind the thing), or d) standing
on the other side of the wall, near the safe (SL lets you pan you camera
through things, with some of its controls, so you can't stop them
clicking the thing, through a wall. This means a very narrow range of
"usable" space, and distance. And the "alley" I need to test, is not
much wider than the safe itself.
I could have gotten by with a fairly simple "angle" test, and distance,
to see if they where close enough, in this specific case. But, not so
with something bigger, like my hypothetical garage door.
Hmm. There is a possibility though..
avPos = llDetectedPos(0);
cPos = llGetPos(0);
ab = llGetAngleBetween(avPos, cPos);
TestDistance = ???(ab) * 5;
I.e., make the angle determine the "distance" so that every point in the
detection range will "always" be the same distance from the object. Ur..
What would be the math for drawing a straight line, using a string,
attached to a immobile peg exactly? lol
Post a reply to this message
|
|