PRIM POSITION

From Second Life Wiki
Jump to navigation Jump to search

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.
  • Moving a prim that an avatar is seated upon will not move the avatar; the sit target will not be updated.
  • Moving avatars with PRIM_POSITION
    • 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, use UpdateSitTarget.
    • If position is greater than 54 meters (when reposition an avatar), the repositioning will silently fail.

Avatars

Avatars sitting on the object can be moved with llSetLinkPrimitiveParams and PRIM_POSITION. This was originally a mis-feature but according to Andrew Linden LL has decided to support it.

Examples

The below example moves an avatar to x,y,z without moving the prim they are sitting on. If x,y,z is more than 54 meters away the call 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: llSetLinkPrimitiveParams(llGetNumberOfPrims(), [[[PRIM_POSITION]], <x,y,z>]);

llGetPrimitiveParams

llGetPrimitiveParams([ ..., PRIM_POSITION, ... ]);

Returns the list [ vector position ]

• vector position position in region coordinates.

Caveats

Caveats


Related Articles

Constants

•  PRIM_ROTATION

Functions

•  llGetPrimitiveParams
•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llGetPos
•  llSetPos
•  llGetLocalPos
•  llGetRootPosition
•  llGetObjectDetails

Articles

•  warpPos

Deep Notes

Search JIRA for related Issues

Signature

integer PRIM_POSITION = 6;