Jump to content

llSetLinkPrimitiveParams function


Zoraster Lunardi
 Share

You are about to reply to a thread that has been inactive for 4642 days.

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

Recommended Posts

Hi

Does the PRIM_POSITION parameter work in the llSetLinkPrimitiveParams function?

I have constructed a test script with 5 basic PRIMS linked together. My other link functions are working.

This is the code line I am using: llSetLinkPrimitiveParams(5, [PRIM_POSITION, PRIMPOS2]);

I am trying to move one linked PRIM in a linked set.

Zor



Link to comment
Share on other sites

PRIMPOS2 needs to be local to the root prim for Set.  Note that the corresponding Get functions return REGION coordinates, not local coordinates.  If you pass a region coordinate to PRIM_POSITION for a child prim, it would usually result in a move of more than 65 meters, which causes it not to move at all.

 

  • Like 1
Link to comment
Share on other sites


Zoraster Lunardi wrote:

I can see that I can make my app work – but it will be a bit more tedious. I am trying to make a subset of PRIMS move as a single sub object.

It would be fairly straight forward if I could get each child object to move relative to its own local position.

The local position can be computed if you know:

  1. the child's global position
  2. the root's position
  3. the root's rotation

This snippet can compute any child prims local position even if it is in another prim in the linkset

integer dg; // child prim numberlist childPR = llGetLinkPrimitiveParams( dg, [PRIM_POSITION]);vector local_pos = (llList2Vector( childPR, 0)-llGetRootPosition())/llGetRootRotation();

 

Link to comment
Share on other sites

please note that llGetRootRotation should not be used for objects that will be attacments...

llGetLocalRot() //-- is what you want when called from the root

or

llList2Rot( llGetLinkPrimitiveParams( LINK_ROOT, [PRIM_ROT_LOCAL] ), 0 ) //-- called from any prim if it's a set

or

llList2Rot( llGetLinkPrimitiveParams( !!llGetLinkNumber, [PRIM_ROT_LOCAL] ), 0 ) //-- called from any prim, linkset or not.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4642 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
 Share

×
×
  • Create New...