Advertisement
Dorex

Untitled

Jul 31st, 2023
3,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rotation NormRot(rotation Q){    
  2.     float MagQ = llSqrt(Q.x*Q.x + Q.y*Q.y +Q.z*Q.z + Q.s*Q.s);    
  3.     Q.x = Q.x/MagQ;    
  4.     Q.y = Q.y/MagQ;    
  5.     Q.z = Q.z/MagQ;    
  6.     Q.s = Q.s/MagQ;    
  7.     return Q;
  8. }
  9.  
  10.  
  11. rotation rot = <0.00000, 0.00000, -0.45399, 0.89101>;
  12.  
  13. default
  14. {
  15.     state_entry()
  16.     {
  17.         llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);
  18.     }
  19.  
  20.     touch_start(integer total_number)
  21.     {
  22.         //
  23.         // Error: delta rotation at frame 0 contains a NaN, Inf, or is not a normalized rotation.
  24.         //
  25.         // llSetKeyframedMotion( [<3.57939, 0.00000, 0.00000>,
  26.         //                        rot,
  27.         //                        3],
  28.         //                       [ KFM_MODE, KFM_FORWARD ]);
  29.                              
  30.  
  31.         rotation normalized = NormRot(rot);    
  32.         llOwnerSay((string)normalized);
  33.  
  34.         llSetKeyframedMotion( [<3.57939, 0.00000, 0.00000>,
  35.                               normalized,
  36.                               3.579391],
  37.                               [ KFM_MODE, KFM_FORWARD ]);
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement