OsLocalTeleportAgent
From OpenSimulator
(One intermediate revision by one user not shown) | |||
Line 9: | Line 9: | ||
vector TPvel = <0,0,0>; | vector TPvel = <0,0,0>; | ||
vector LookAt = <1,1,0>; // which way they look at when arriving | vector LookAt = <1,1,0>; // which way they look at when arriving | ||
− | + | ||
// | // | ||
default | default | ||
Line 21: | Line 21: | ||
key avatar = llDetectedKey(0); | key avatar = llDetectedKey(0); | ||
llInstantMessage(avatar, "Teleporting you to : " + (string)LandingPoint); | llInstantMessage(avatar, "Teleporting you to : " + (string)LandingPoint); | ||
− | osLocalTeleportAgent(avatar, LandingPoint, TPvel, LookAt, | + | osLocalTeleportAgent(avatar, LandingPoint, TPvel, LookAt, OS_LTPAG_USELOOKAT | OS_LTPAG_FORCEFLY); |
} | } | ||
}</source> | }</source> | ||
Line 40: | Line 40: | ||
- OptionFlags is a bit field:<br> | - OptionFlags is a bit field:<br> | ||
− | bit 0 ( | + | bit 0 (OS_LTPAG_USEVEL): use newVelocity<br> |
− | bit 1 ( | + | bit 1 (OS_LTPAG_USELOOKAT): use newLookAt<br> |
− | bit 2 ( | + | bit 2 (OS_LTPAG_ALGNLV): align lookat to velocity if it is not zero vector<br> |
− | bit 3 ( | + | bit 3 (OS_LTPAG_FORCEFLY): force fly.<br> |
− | bit 4 ( | + | bit 4 (OS_LTPAG_FORCENOFLY): force no fly. Will not work if viewer has fly after teleport option set<br> |
<br> | <br> | ||
if both bits 1 and 2 are set bit 2 is ignored<br> | if both bits 1 and 2 are set bit 2 is ignored<br> |
Revision as of 15:42, 2 May 2019
osLocalTeleportAgent(key agentID, vector newPosition, vector newVelocity, vector newLookat, integer optionFlags)
| |
Caution ! still experimental, subject to changes Teleports an avatar with uuid agentID to the specified newPosition within same region. - OptionFlags is a bit field: | |
Threat Level | None |
Permissions | see description |
Extra Delay | 0 seconds |
Example(s) | |
vector LandingPoint = <128,128,50>; // X,Y,Z landing point for avatar to arrive at vector TPvel = <0,0,0>; vector LookAt = <1,1,0>; // which way they look at when arriving // default { state_entry() { llWhisper(0, "OS Local Teleport Active"); } touch_start(integer num_detected) { key avatar = llDetectedKey(0); llInstantMessage(avatar, "Teleporting you to : " + (string)LandingPoint); osLocalTeleportAgent(avatar, LandingPoint, TPvel, LookAt, OS_LTPAG_USELOOKAT | OS_LTPAG_FORCEFLY); } } |