llSetRegionPos

From Second Life Wiki
Revision as of 12:17, 5 January 2012 by Strife Onizuka (talk | contribs) (Created page with "{{LSL Function |func_id=?|func_sleep=0.0|func_energy=0.0 |func=llSetRegionPos |p1_type=vector|p1_name=position|p1_desc=position in [[Viewer coordinate frames#Region|region coordi…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: integer llSetRegionPos( vector position );

Tries to moves the entire object so that the root prim is within 0.1m of position.
Returns an integer boolean, TRUE if the object is successfully placed within 0.1 m of position, FALSE otherwise. See #Specification for details.

• vector position position in region coordinates

Only if TRUE is returned does the object move, if FALSE is returned, the object does not change position.

Specification

The object with the script will move the root prim position to the given location. The position is any position within the region. If the position is below ground, it will be set to the ground level at that X,Y spot. The function has no delay or throttle.

  • Returns TRUE if the object is successfully placed within 0.1 m of position.
  • Returns FALSE and does not move the object if...
    • position is more than 10m off region or above 4096m.
      • The x & y components of position must be in the range [-10.0, 266.0].[1]
      • The z component must be in the range [0.0, 4096].
    • the object is dynamic (has physics enabled).
    • the object can not move to position due to parcel/region restrictions (object entry rules, prim limits, bans, etc).

Examples

Notes

This function is intended to replace WarpPos.

See Also

Functions

•  llGetLocalPos Returns the prim's local position if it is attached or non-root (otherwise it returns the global position)
•  llGetRootPosition Gets the root prims position
•  llGetPos Returns the prim's global position, even if it is attached or non-root
•  llSetPos

Deep Notes

History

  • New LSL function integer llSetRegionPos(vector position) in Second Life RC BlueSteel 12.01.03.247042
    The object with the script will move the root prim position to the given location. The position is any position within the region. If the position is below ground, it will be set to the ground level at that X,Y spot. The function has no delay or throttle.
    • Returns 1 if the object is successfully placed within 0.1 m of position.
    • Returns 0 and does not move the object if position is more than 10m off region or above 4096m.
    • Returns 0 and does not move the object if the object is dynamic (has physics enabled).
    • Returns 0 and does not move the object if the object can not move to position due to object entry rules, prim limits, bans, etc.

Footnotes

  1. ^ The ranges in this article are written in Interval Notation.

Signature

function integer llSetRegionPos( vector position );