Jump to content
You are about to reply to a thread that has been inactive for 4827 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

Anyone know of this issue or a workaround?  I am trying to use llSetLinkPrimitiveParams() from a script in the root object to move a child prim using PRIM_POSITION.  Changing PRIM_SIZE with this function works fine so I know my syntax and vector values are correct.  The child prim just does not move using PRIM_POSITION.

Is this a known bug or is there another approach I should be using?

 

Posted

PRIM_POSITION returns a region coodinate when using "get" but uses Local coordinates when setting.

untill we get PRIM_POS_LOCAL (it's in the works) you will have to do the following to get a local position of a child prim...

(llGetLinkPrimitiveParams( link_number, [PRIM_POSITION] ) - llGetLinkPrimitiveParams( LINK_ROOT, [PRIM_POSITION] )) / llGetLinkPrimitiveParams( 1, [PRIM_ROT_LOCAL] )

or more generally

(childRegionPos - rootRegionPos) / rootRegionRot

 

the first formula works for attachments, but there are simpler variation that work for rezzed objects

 

also note, that if the child prim is in an attachment, small movements won't register a change to the viewer, unless you trigger a full object update (using llSetText is one thing that does this), or by triggering two large movements (one away from the original position, and on to the new position)

  • Like 1
Posted

Interesting info, thank you.  I am just trying to set the local location, are you saying I have to GET it before I can SET?  I would think the function would work as if just entering it in the edit window.

 

Posted

PRIM_POSITION is global. To move the child prim, as Void says, you first need to know what it is (hence the need to use GLPP).  Then you need to convert it to a local position (hence the need for the calculation). THEN you get to set it with SLPPF.

  • Like 1
Posted


DanMan Flamand wrote:

[...] are you saying I have to GET it before I can SET?  I would think the function would work as if just entering it in the edit window.

only if you are trying to offset the current position without knowing the current... if the current position doesn't matter to you, then the only caveats are attachment and link distance rules.

  • 1 month later...
You are about to reply to a thread that has been inactive for 4827 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...