Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Get local position of OTHER prim in linkset?

Dylan Rickenbacker
Animator
Join date: 11 Oct 2006
Posts: 365
04-03-2008 23:39
... that is, get the local position of a prim in the linkset other than the one the script resides in - is there a way to do that?
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
04-04-2008 02:48
Not very cleanly, you could do:

CODE

integer LINK_NUMBER = 4;
list details = llGetObjectDetails(llGetLinkKey(LINK_NUMBER), [OBJECT_POS]);
vector localPos = (llList2Vector(details, 0) - llGetRootPosition()) / llGetRootRotation();


It's not pretty, but if speed isn't essential then it should do what you require (don't quote me on the rotation bit, it /should/ work but rotations never agree with me).
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)