salahzar

tartaruga

Apr 5th, 2013
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. vector r1=<135, 0, 0>; // rotazione senso 1
  2. vector r2=<225, 0, 180>; // rotazione senso 2
  3.  
  4. vector p1=<85.4375, 38.4954-2, 23.3226>; // punto 1 della spola
  5. vector p2=<51.8792, 41.5985-2, 23.3226>; // punto 2 della spola
  6.  
  7. integer FACT=100; // quantità di passi per senso di marcia
  8.  
  9. vector diff;
  10. vector from;
  11. vector to;
  12.  
  13. default
  14. {
  15.     state_entry()
  16.     {
  17.         llSetRot(llEuler2Rot(DEG_TO_RAD*r1));
  18.         diff=(p2-p1)/FACT; from=p1; to=p2;
  19.         llSetPos(p1);
  20.         llSetTimerEvent(0.5);
  21.  
  22.     }
  23.    timer()
  24.     {
  25.         if(llVecDist(llGetPos(),to)<3) state state2;
  26.         llSetPos(llGetPos()+diff);
  27.     }
  28. }
  29. state state2
  30. {
  31.     state_entry()
  32.     {
  33.         llSetRot(llEuler2Rot(DEG_TO_RAD*r2));
  34.         diff=(p1-p2)/FACT; from=p2; to=p1;
  35.         llSetPos(p2);
  36.         llSetTimerEvent(0.5);
  37.  
  38.     }
  39.    timer()
  40.     {
  41.         if(llVecDist(llGetPos(),to)<3) state default;
  42.         llSetPos(llGetPos()+diff);
  43.     }
  44. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×