Difference between revisions of "PRIM POSITION"
Jump to navigation
Jump to search
m |
m (omg i forgot how confusing the PRIM_* articles are to edit ~_~) |
||
Line 22: | Line 22: | ||
{{#vardefine:p_positionset_desc|position in [[Viewer_coordinate_frames#local|local]] or [[Viewer_coordinate_frames#region|regional]] coordinates depending upon the situation.}} | {{#vardefine:p_positionset_desc|position in [[Viewer_coordinate_frames#local|local]] or [[Viewer_coordinate_frames#region|regional]] coordinates depending upon the situation.}} | ||
{{#vardefine:p_positionset_hover|position in local or regional coordinates depending upon the situation.}} | {{#vardefine:p_positionset_hover|position in local or regional coordinates depending upon the situation.}} | ||
{{#vardefine:PRIM_POSITION/SLPP&A| | |||
Avatars sitting on the object can be moved with [[llSetLinkPrimitiveParams]] and [[PRIM_POSITION]]. This was originally a mis-feature but according to [http://jira.secondlife.com/browse/SVC-3408?focusedCommentId=88574#action_88574 Andrew Linden] LL has decided to support it. | |||
=====Be Aware===== | |||
* Moving the prim the avatar sat upon does not move the avatar. | |||
* Moving an avatar does not move the prim they sat upon. | |||
* Sit-target coordinates do not easily map to prim coordinates | |||
** To mimic updating of a sit-target, use UpdateSitTarget found here: [[llSitTarget#Useful_Snippets]]<br>All the nasty work of translating the coordinates has been done. | |||
The below example moves avatar to x,y,z without moving the prim they are sitting on. If x,y,z is more than 54 meters away the function will silently fail. Remember x,y,z is in object relative coordinates just like any other linked prim in a set. | |||
Avatars are always the last prims in the set, so [[llGetNumberOfPrims]] can be used for a single avatar sitting on a vehicle. | |||
Example: <code>llSetLinkPrimitiveParams([[llGetNumberOfPrims]](), [[[PRIM_POSITION]], <x,y,z>]);</code> | |||
}} | |||
}}</onlyinclude>{{#if: | }}</onlyinclude>{{#if: | ||
Line 31: | Line 47: | ||
|desc=PRIM_POSITION is used to get or set the prim's position. | |desc=PRIM_POSITION is used to get or set the prim's position. | ||
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ ..., {{#var:position_const}}, |i_end=, ... ]); | |pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ ..., {{#var:position_const}}, |i_end=, ... ]); | ||
|text=The same syntax | |text=The same syntax applies to [[llSetLinkPrimitiveParams]], but with the addition of a {{LSLGC|Link|link}} parameter. | ||
===Caveats=== | ===Caveats=== | ||
{{#var:caveats-set}} | {{#var:caveats-set}} | ||
===[[llSetLinkPrimitiveParams]] and {{LSLGC|Avatar|Avatars}}=== | |||
While [[llSetLinkPrimitiveParams]] can be used to update the positions | |||
|i1_type=vector|i1_name=positionset|i1_disp=position | |i1_type=vector|i1_name=positionset|i1_disp=position | ||
|toc=llSetPrimitiveParams | |toc=llSetPrimitiveParams | ||
Line 47: | Line 65: | ||
|examples | |examples | ||
|constants= | |constants= | ||
{{LSL ConstRow|PRIM_ROTATION}} | |||
|functions= | |functions= | ||
{{LSL DefineRow||[[llGetPrimitiveParams]]|}} | {{LSL DefineRow||[[llGetPrimitiveParams]]|}} | ||
Line 57: | Line 75: | ||
{{LSL DefineRow||[[llGetRootPosition]]|}} | {{LSL DefineRow||[[llGetRootPosition]]|}} | ||
{{LSL DefineRow||[[llGetObjectDetails]]|}} | {{LSL DefineRow||[[llGetObjectDetails]]|}} | ||
|events | |events | ||
|articles= | |articles= | ||
{{LSL DefineRow||[[warpPos]]|}} | {{LSL DefineRow||[[warpPos]]|}} |
Revision as of 19:16, 3 May 2009
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: integer PRIM_POSITION = 6;The integer constant PRIM_POSITION has the value 6
PRIM_POSITION is used to get or set the prim's position.
llSetPrimitiveParams
llSetPrimitiveParams([ ..., PRIM_POSITION, vector position, ... ]);• vector | position | – | position in local or regional coordinates depending upon the situation. |
The same syntax applies to llSetLinkPrimitiveParams, but with the addition of a link parameter.
Caveats
- Depending upon the situation position may need to be in local coordinates or region coordinates, See llSetPos#Specification for details.
- The range the prim can move is limited if it is an unattached root prim. The distance is capped to 10m per PRIM_POSITION call. See WarpPos. This is a very special case. Do not rely on rule duplication of other flags - the results are undefined, and things will break in the future.
llSetLinkPrimitiveParams and Avatars
While llSetLinkPrimitiveParams can be used to update the positions
llGetPrimitiveParams
llGetPrimitiveParams([ ..., PRIM_POSITION, ... ]);Returns the list [ vector position ]
• vector | position | – | position in region coordinates. |
Caveats
- position is always in region coordinates, even if the prim is a child or the root prim of an attachment.
Caveats
Related Articles
Constants
• | PRIM_ROTATION |
Functions
• | llGetPrimitiveParams | |||
• | llSetPrimitiveParams | |||
• | llSetLinkPrimitiveParams | |||
• | llGetPos | |||
• | llSetPos | |||
• | llGetLocalPos | |||
• | llGetRootPosition | |||
• | llGetObjectDetails |
Articles
• | warpPos |