Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to get a child prim's region position

Dzar Overlord
Registered User
Join date: 16 Mar 2007
Posts: 8
04-07-2007 00:46
How does one get the region position of a child prim in a link set no matter what rotation or position that the root prim is at? Basically I need the child prim to know where it's located in the sim but still be able to move and rotate with the parent prim just update it's memory of where it is.

I believe from other threads that quaternions are involved but that's about it. I can't quite grasp the math behind them. That is also assuming that the other threads were talking about what it is I'm looking for. Perhaps if I understood the math I'd know but then again I wouldn't have this question in the first place.

Thanks.
Thraxis Epsilon
Registered User
Join date: 31 Aug 2005
Posts: 211
04-07-2007 01:43
Add the child prims local position to the parent prims region position
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-07-2007 02:24
You should be abel to use llGetPos for teh position:

From: The Wikki
vector llGetPos()

Returns the prim's position in region coordinates, which are relative to the simulator's southwest corner.

When called from within a child prim in a linked set, it returns the position of the child in region coordinates, not the parent's position.
To get the position of a child object relative to its parent, use llGetLocalPos. To get the position of the parent from a script within a child prim, use llGetRootPosition.
Dzar Overlord
Registered User
Join date: 16 Mar 2007
Posts: 8
Talk about over complicating it on my part.
04-07-2007 02:57
Talk about over complicating it on my part. For some reason I just had it stuck in my head that llGetPos() only gave the parent's position. Note to self: double check functions on the wiki if I ever get stuck. Got it :). Thanks for the help.