[Opensim-dev] Trying to understand llDetected* functions

Tedd Hansen tedd at konge.net
Tue Jun 17 09:14:42 UTC 2008


Hi

Number of items passed with an event such as touch_start will always be
1.

LL has a slightly different architecture where they pile up all requests
of a certain type before they fire the script event. We just queue the
whole event. Therefore if 10 people touch_start an object within 10 ms
then toch_start will be executed 10 times with 1 parameter (as opposed
to LL who would execute 1 touch_start with 10 parameters).

What data is brought into this 1 parameter varies depending on LSL2
specification of what command it is. All events have the option to bring
some private data for the executing event-function to read.

- Tedd

-----Original Message-----
From: opensim-dev-bounces at lists.berlios.de
[mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Mike Mazur
Sent: 17. juni 2008 08:54
To: opensim-dev at lists.berlios.de
Subject: [Opensim-dev] Trying to understand llDetected* functions

Hello,

I'm trying to wrap my head around how llDetected* functions work in
OpenSim.

Here's what I know so far:
- these functions tell you something about either a prim/object or
avatar
- they only apply in certain events (collision{,_start,_end},
touch{,_start,_end} and sensor)
- they take a number as an argument which is an index of the object

I may have some of that mixed up a bit...

I traced through the code for touch_start to try to figure this out.
First, in
OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
line 119 the touch_start function is executed and an llDetectParams
struct is filled in. The arrays in the struct are all 1 in size, and
are filled with some values.

What exactly do these values represent? According to
OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
line 152, _key is "detected key" and _key2 is "owner key". What are
these exactly? The position, velocity, rotation and _string (name)
properties make sense, but the _bool and _int ones don't.

This llDetectParams struct is then assigned to the script, and accessed
in OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs in
functions llDetectedName() (line 554), uuidDetectedKey() (line 595) and
entityDetectedKey() (line 632).

The number argument to each of those functions is used to index the
arrays in the llDetectParams struct (_key, _key2, etc). This array is
always initialized to size 1. Is the number argument ever not 0? Do
those arrays inside the llDetectParams struct ever grow or shrink?

Also, how does the event that is triggered affect the number passed in?
Is it different for collosion_start and touch_start for instance?

Finally, which object is usually referred to in those llDetected*
functions? For example, if I have a box with a script that calls
llDetectedVel() in its touch_start event, will llDetectedVel return the
velocity of the box at the instant it is touched by an avatar? Or maybe
it's the velocity of the avatar?

A lot of questions, but here's hoping someone can clear this up a bit
further.

Thanks,
Mike
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev





More information about the Opensim-dev mailing list