Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetPos/llSetRot from a child prim

Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
10-24-2005 18:28
In a child prim, llSetPos works relative to the root prim (and there is no llSetLocalPos), while llSetRot works on the global axis (and llSetLocalRot needs to be used for local rotations). Is there a specific reason for this? Also, llSetPrimitiveParams seems to do the same thing. I can call llGetLocalPos and llGetLocalRot and save them to local variables, then call llSetPrimitiveParams with those two values, and the object will change rotation (at least, I think that's what was going on, I was doing other stuff in the script). Is there any way to get around this other than factor in llGetRootRot for every rotation? And how well will that work for a moving object anyway?

It seems to me that it would be nice if positions and rotations worked the same way in child prims, or if there was a PRIM_LOCAL_ROTATION option in llSetPrimitiveParams. Or, I'm completely missing something about rotations.
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
10-25-2005 02:25
From: Ziggy Puff
In a child prim, llSetPos works relative to the root prim (and there is no llSetLocalPos), while llSetRot works on the global axis (and llSetLocalRot needs to be used for local rotations). Is there a specific reason for this?

LL doesn't need REASONS to be inconsistent with LSL functions :D

From: someone
Also, llSetPrimitiveParams seems to do the same thing. I can call llGetLocalPos and llGetLocalRot and save them to local variables, then call llSetPrimitiveParams with those two values, and the object will change rotation (at least, I think that's what was going on, I was doing other stuff in the script). Is there any way to get around this other than factor in llGetRootRot for every rotation? And how well will that work for a moving object anyway?

Nope, no workaround. To change the position and rotation of a child prim in a linked set you have to use llSetPrimitiveParams([PRIM_POSITION, pos, PRIM_ROTATION, rot / llGetRootRotation()]);

From: someone
It seems to me that it would be nice if positions and rotations worked the same way in child prims, or if there was a PRIM_LOCAL_ROTATION option in llSetPrimitiveParams. Or, I'm completely missing something about rotations.

I wish it did too :( I lost a good number of brain cells trying to figure it all out...
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
10-25-2005 08:39
Thanks. Glad I'm not the only one :)