Advertisement
theguild42

rotate child from root

Mar 10th, 2020
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. rotation rot_xyzq;
  2.  
  3. default
  4. {  
  5.     state_entry()
  6.     {
  7.         vector xyz_angles = <0,1.0,0>; // This is to define a 1 degree change
  8.         vector angles_in_radians = xyz_angles*DEG_TO_RAD; // Change to Radians
  9.         rot_xyzq = llEuler2Rot(angles_in_radians); // Change to a Rotation
  10.     }
  11.    
  12.     touch_start(integer num_detected)
  13.     {
  14.         llSetLinkPrimitiveParamsFast(LINK_ROOT, [
  15.                 PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, 1.0]);
  16.         llSetLinkPrimitiveParamsFast(2, [
  17. //                PRIM_ROT_LOCAL, llList2Rot(llGetLinkPrimitiveParams(!!llGetLinkNumber(), [PRIM_ROT_LOCAL]), <70.0,0.0,0.0>),
  18.                 PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, 1.0]);
  19.                 llSetRot(llGetRot()*rot_xyzq/llGetRootRotation()/llGetRootRotation()); //Do the Rotation...
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement