Jump to content

Rotating child prims on an attached object


Recommended Posts

I'm working on an attached accessory and I'm trying to figure out how to rotate only certain linked prims. I do not want to rotate the root as it rotates the whole object. I have 6 linked prims including the root. I need to rotate/spin prims 2, 4, 5 and 6 on the z axis. The prims needs to rotate around the z axis, in place. I'm not trying to create an orbiting object.

I've been messing around for days but can't figure it out. llSetLinkPrimitiveParamsFast doesn't work on child prims on an attached object went it comes to rotation by the looks of it. And TargetOmega only spins the object client side.

 

Any help would be amazing.

Link to comment
Share on other sites

To rotate the child prim 20 degrees on it's own z-axis:

rotation Z20 = llAxisAngle2Rot(<0,0,1>,20*DEG_TO_RAD);
// for example 
integer link = 2;
rotation rChild = llList2Rot(llGetLinkPrimitiveParams(link,[PRIM_ROTATION]),0);
llSetLinkPrimitiveParamsFast(link,
[   PRIM_ROT_LOCAL,  (Z20*rChild)/llGetRootRotation()
]);

for root's axes, swap the order of the change and orientation rotations:

[   PRIM_ROT_LOCAL,  (rChild*Z20)/llGetRootRotation() 

 

Edited by Quistess Alpha
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...