OsLocalTeleportAgent
From OpenSimulator
Line 42: | Line 42: | ||
- If newPosition is outside the region the target will be at nearest region border.<br> | - If newPosition is outside the region the target will be at nearest region border.<br> | ||
- newVelocity, if selected in optionFlags bit 0, should set a avatar velocity, but may only work with ubOde Physics engine, even so results may be a bit unpredictable. It will stop if the avatar collides with anything at destination or if the user presses a movement key. It also has a strong drag. This behavior will need future changes.<br> | - newVelocity, if selected in optionFlags bit 0, should set a avatar velocity, but may only work with ubOde Physics engine, even so results may be a bit unpredictable. It will stop if the avatar collides with anything at destination or if the user presses a movement key. It also has a strong drag. This behavior will need future changes.<br> | ||
− | - newLookAt, if selected in optionFlags bit 1, changes the camera look At direction. bit 2 can alternatively be used to align the look at to the velocity at arrival. Final effect may depend on viewer and viewer camera state at teleport time (like camera attached to avatar or free)<br> | + | - newLookAt, if selected in optionFlags bit 1, changes the camera look At direction. bit 2 can alternatively be used to align the look at to the velocity at arrival if this is not Zero. Final effect may depend on viewer and viewer camera state at teleport time (like camera attached to avatar or free)<br> |
- OptionFlags is a bit field:<br> | - OptionFlags is a bit field:<br> | ||
bit 0 (mask 1): use newVelocity<br> | bit 0 (mask 1): use newVelocity<br> | ||
bit 1 (mask 2): use newLookAt<br> | bit 1 (mask 2): use newLookAt<br> | ||
− | bit 2 (mask 4): align lookat to velocity if not zero<br> | + | bit 2 (mask 4): align lookat to velocity if it is not zero vector<br> |
bit 3 (mask 8): fly<br> | bit 3 (mask 8): fly<br> | ||
bit 4 (mask 16): do not fly<br> | bit 4 (mask 16): do not fly<br> |
Revision as of 14:02, 1 May 2019
void 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 | Severe |
Permissions | ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |
Extra Delay | 5 seconds |
Example(s) | |
vector LandingPoint = <128,128,50>; // X,Y,Z landing point for avatar to arrive at vector LookAt = <1,1,1>; // which way they look at when arriving // default { on_rez(integer start_param) { llResetScript(); } changed(integer change) // something changed, take action { if(change & CHANGED_OWNER) llResetScript(); else if (change & 256) // that bit is set during a region restart llResetScript(); } state_entry() { llWhisper(0, "OS Teleportal Active"); } touch_start(integer num_detected) { key avatar = llDetectedKey(0); llInstantMessage(avatar, "Teleporting you to : " + (string)LandingPoint); osLocalTeleportAgent(avatar, LandingPoint, ZEROVECTOR, <0,1,0>, 2); } } |