Jump to content
Sign in to follow this  
Tristus Patton

llGetLinkPrimitiveParams with llGetLocalPos..is it possible?

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

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

Recommended Posts

So I love this llGetLinkPrimitiveParams, after a long time I finally got it to work for me, my issue is Im trying to do a "get local position". From what I understand, when you get the position, it only gets global position. Which is totally not helpful at all. I know that they have a way to get the Local Rotation, but again what I need is Local Position. I have an idea on how I can, but that includes putting a script into every prim, which kinda defeats the purpose of having the llGetLinkPrimitiveParams script.

Share this post


Link to post
Share on other sites

Yeah, we could use PRIM_POS_LOCAL to match PRIM_ROT_LOCAL.  Maybe someday.  All is not lost, though.  Local position is just a position relative to the root prim, so you can calculate it easily if you know both of those values in global coordinates. .....

vector Gpos = (vector) llList2String(llGetLinkPrimitiveParams(linkno,[PRIM_POSITION]),0);

vector Lpos = ( Gpos - llGetPos() ) / llGetRot();

You can then move your child prim by adding an offset (corrected for the root rotation) to Lpos and then use

llSetLinkPrimitiveParamsFast(linkno, [PRIM_POSITION, Lpos]);

Share this post


Link to post
Share on other sites

vector Lpos = ( Gpos - llGetPos() ) / llGetRot();

 

there's a jira in for PRIM_POS_LOCAL that was just recently marked fix pending.... so a month or less untill it hits main channel.

Share this post


Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 3267 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...