Jump to content

llGetLinkPrimitiveParams with llGetLocalPos..is it possible?


Tristus Patton
 Share

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

Link to comment
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]);

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...