Difference between revisions of "PosJump"

From Second Life Wiki
Jump to navigation Jump to search
Line 2: Line 2:


<lsl>
<lsl>
posJump(vector dest_pos)
posJump(vector target_pos)
{
{
// An alternative to the warpPos trick without all the overhead.
// An alternative to the warpPos trick without all the overhead.
// Trickery discovered by Uchi Desmoulins and Gonta Maltz.  More exact value provided by Fake Fitzgerald.
// Trickery discovered by Uchi Desmoulins and Gonta Maltz.  More exact value provided by Fake Fitzgerald.
llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, dest_pos]);
llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, target_pos]);
}
}
</lsl>
</lsl>




If your destination position is no-entry, your object is likely to go offworld.  So Alias Turbo included a step that sends the object back to its starting position.  In other words, if it can't enter the target position, it doesn't move at all.
If the target position turns out to be no-entry, your object will go offworld.  So Alias Turbo included a step that sends the object back to its starting position before trying the target position againSo if it can't enter the target position, it doesn't move at all.
<lsl>
<lsl>
safe_posJump(vector dest_pos)
safe_posJump(vector target_pos)
{
{
// An alternative to the warpPos trick without all the overhead.
// An alternative to the warpPos trick without all the overhead.
// Trickery discovered by Uchi Desmoulins and Gonta Maltz.  More exact value provided by Fake Fitzgerald.  Safe movement modification provided by Alias Turbo.
// Trickery discovered by Uchi Desmoulins and Gonta Maltz.  More exact value provided by Fake Fitzgerald.  Safe movement modification provided by Alias Turbo.
       vector start_pos = llGetPos();
       vector start_pos = llGetPos();
llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, destpos, PRIM_POSITION, start_pos, PRIM_POSITION, destpos]);
llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, target_pos, PRIM_POSITION, start_pos, PRIM_POSITION, target_pos]);
}
}
</lsl>
</lsl>

Revision as of 18:29, 10 October 2008

Here's an interesting method for bypassing the 10m limitation in Non-Physical movement. It has its similarities to warpPos, but with minimal overhead.

<lsl> posJump(vector target_pos) { // An alternative to the warpPos trick without all the overhead. // Trickery discovered by Uchi Desmoulins and Gonta Maltz. More exact value provided by Fake Fitzgerald. llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, target_pos]); } </lsl>


If the target position turns out to be no-entry, your object will go offworld. So Alias Turbo included a step that sends the object back to its starting position before trying the target position again. So if it can't enter the target position, it doesn't move at all. <lsl> safe_posJump(vector target_pos) { // An alternative to the warpPos trick without all the overhead. // Trickery discovered by Uchi Desmoulins and Gonta Maltz. More exact value provided by Fake Fitzgerald. Safe movement modification provided by Alias Turbo.

     vector start_pos = llGetPos();

llSetPrimitiveParams([PRIM_POSITION, <1.304382E+19, 1.304382E+19, 0.0>, PRIM_POSITION, target_pos, PRIM_POSITION, start_pos, PRIM_POSITION, target_pos]); } </lsl>


Don't rely on this behavior without first discussing it with a Physics Linden. It's certainly a bug, and likely to be fixed.