CODE
llSetLocalRot(llGetLocalRot());
Because Get/SetLocalRot both work relative to the attachment's root prim. However, I can't find anything that will work with llSetPrimitiveParams.
CODE
llSetPrimitiveParams([PRIM_ROTATION, llGetLocalRot()]);
That doesn't work, and there's stuff in the Wiki and the scripting library that says that PRIM_ROTATION works like llSetRot in a child prim, not llSetLocalRot, so you need to divide by the root rotation. But this doesn't work either:
CODE
llSetPrimitiveParams([PRIM_ROTATION, llGetLocalRot() / llGetRootRotation()]);
The prim still changes its rotation. Probably because llGetRootRotation returns the root prim's rotation in an unattached object, but returns the avatar's rotation in an attachment. So that call would work in an unattached object, but not an attachment (in a child prim).
Once I figured that out, I finally understood the Child Rotation page in the Wiki. And the only solution described is 'pass the rotations around'. Which means, call llGetLocalRot in the root prim, then send that information out to all the child prims?
If there is an invariant operation, then it should be possible to calculate this. If there isn't one, then it's basically impossible for an attachment's child prim to know its rotation relative to the root prim?
I want to use llSetPrimitiveParams so I can set the position/rotation in a single step. The other idea I had was to use 2 scripts per child prim, have both pick up the link message trigger, and one sets the position, one sets the rotation. Then I can use Get/SetLocalRot, which will work correctly, and also avoid the 0.2s delay. But that's kinda cheap, and cheating, and wasting resources, and probably won't look as smooth as using llSetPrimitiveParams, I'm pretty sure I'll still get some "2-step" movement. But if that's the only way to get the correct rotations...
Or I'm totally missing something, and there is a way to do this. And if there is, I would really appreciate it if someone told me how

Ziggy