Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Local Position of Linked Prims, from a Root Prim Script

Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
03-20-2009 03:56
Hi

I need some help in working out how to determine the Local Position of Linked prims, but from a script that resides in the Root prim.

Obviously this would be easy if a script was in the Linked prim - llGetLocalPos() and a linked message back to the Root prim script.

But for this project, I want to avoid a script in every prim in the object.

So I am looking for a solution that would be functionally equivalent to “llGetLinkLocalPos()” or “llGetLinkPrimitiveParams(LINK_NUMBER, [PRIM_POSITION....])” where these (hypothetical) functions would be in the script of the Root prim.

Thanks
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
03-20-2009 04:30
use this:

key id = llGetLinkKey(integer linknum);
list L = llGetObjectDetails( id, [ OBJECT_POS, OBJECT_ROT ]);

You will get the global pos and global rot. From that you can compute the local pos and local rot
_____________________
From Studio Dora
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
03-20-2009 04:44
This looks just the trick

Many thanks
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling