ZenMondo's llTargetOmega tutorial

From ZenMondo Wormser, 1 Year ago, written in Linden Scripting, viewed 433 times.
URL http://flynnos.org/flynnbin/view/bc38d89f Embed
Download Paste or View Raw
  1. integer isSpinning;
  2.  
  3.  
  4. //axis is in format <X, Y, Z> put a 1 in the axis around which you wish
  5. //to rotate and a 0 in the axis you do not wish to rotate
  6. vector axis = <0,0,1>;  
  7.  
  8. //spinrate is how fast you wish it to rotate.
  9. // This is in radians per second. (There are 2 * PI Radians in a circle)
  10. float spinrate = 3.0;
  11.  
  12. //Gain is used for phyiscal rotation. In a non-physical prim it still
  13. //needs to be a non-zero value but has no other effect.
  14. float gain = 1.0;
  15.  
  16. {
  17.    
  18.     touch_start(integer total_number)
  19.     {
  20.         if(isSpinning)
  21.         {
  22.             llTargetOmega(<0,0,0>, 0.0, 0.0); //Stop Spinning
  23.             isSpinning = FALSE;
  24.         }
  25.        
  26.         else
  27.         {
  28.             llTargetOmega(axis, spinrate, gain); //Start Spinning
  29.             isSpinning = TRUE;
  30.         }
  31.        
  32.     }
  33. }
  34.  

Reply to "ZenMondo's llTargetOmega tutorial"

Here you can reply to the paste above

captcha