Table of Contents

Walk to a Local Position

24 May 2021

  • C11 - added.
walkto (Commands)
TypeCorrade progressive command
Commandwalkto
DescriptionThe walkto command makes Corrade walk towards a position in a given time duration while getting as close to the vicinity of the position as possible with a specified affinity.
Permissionsmovement
Parametersgroup, password, position
Last ChangesC11 - added.

The walkto command makes Corrade walk towards a position in a given time duration while getting as close to the vicinity of the position as possible with a specified affinity.

Command Required Parameters Required Corrade Permissions Example
walkto group, password, position movement
llInstantMessage(CORRADE,
    wasKeyValueEncode(
        [
            "command", "walkto",
            "group", wasURLEscape(GROUP),
            "password", wasURLEscape(PASSWORD),
            // walk to this object
            "position", llGetPos(),
            // accept a precision of 2 meters from the target
            "vicinity", 2,
            // give Corrade 10 seconds to arrive at this object
            "duration", 10000,
            "callback", wasURLEscape(URL)
        ]
    )
);
Optional Parameter Possible Value Description
duration Time in milliseconds. Allow duration for Corrade to reach position - otherwise, send an error to the callback indicating that Corrade has not properly reached its destination.
vicinity A range in meters (default 2). If Corrade arrives in the vicinity of the position, consider that Corrade has arrived at the destination.
affinity An integer representing the affinity of the movement (default 2). How precise should the movements be?

Duration, Vicinity, Affinity

Let's assume that Corrade can be seen abstractly as a box and that the destination is a primitive.

+-------+           +-------+
|   C   |           |   c   |
+-------+           +-------+
    ^   ^           ^   ^   
    |   |           |   |
    +---+           +---+
      S               s ^
    ^                   |
    |                   |
    +-------------------+
                d
    ^^
    ||
    --
    a

Every avatar in SecondLife has a centre $C$ and is surrounded by an invisible bounding box, the distance between the centre $C$ of the avatar and the side of the bounding box is $S$. A box in SecondLife has a centre $c$ and a projection on one of its sides of distance $s$.

The distance between the avatar and the box is given by $d$ where the distance $d$ includes the projection of the box $s$ and the size of the avatar bounding box $S$. The actual distance between an avatar and the box is in fact $D=d-S-s$ because the distance is measured mathematically (or programatically using llVecDist in LSL) as the distance between two points $C$ and $c$.

The distance between $C$ and $c$, namely $d$ can be decomposed in smaller, equally sized segments $a$.

The definitions of duration, vicinity and affinity are the following:

With the following observations:

Notes