BlueWall

Moving Prim

Aug 14th, 2012
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. vector BlueLake = <256000.000000,255744.000000,0.000000>;
  2. vector localDest;
  3. vector globalDest;
  4.  
  5.  
  6. // Pass a global position to this function, and the object
  7. // will move there.
  8. setGlobalPos(vector globalDest) {
  9.     vector localDest;
  10.     do {
  11.         localDest = globalDest - llGetRegionCorner();
  12.         llSetPos(localDest);
  13.     } while (llVecDist(llGetPos(), localDest) > 0.1);
  14. }
  15.  
  16. default {
  17.     state_entry() {
  18.        localDest = llGetPos() - llGetRegionCorner();
  19.        globalDest = BlueLake + <128,128,35>;
  20.     }
  21.    
  22.     touch_start(integer _det) {
  23.    
  24.         llSetTimerEvent(.5);
  25.        
  26.     }
  27.    
  28.     timer() {
  29.        
  30.         if (llVecDist(llGetPos(), localDest) > 0.1) {
  31.             localDest = globalDest - llGetRegionCorner();
  32.             llSetPos(localDest);
  33.         }
  34.     }
  35. }
RAW Paste Data