Advertisement
worstbull

is_laying_flat

Sep 22nd, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer is_laying_flat(float threshold)
  2. {
  3.     vector zero = llRot2Euler(ZERO_ROTATION);
  4.     vector this = llRot2Euler(llGetRot());
  5.     zero.z = this.z;
  6.     if (llVecDist(zero, this) < threshold)
  7.     {
  8.         return TRUE;
  9.     }
  10.     return FALSE;
  11. }
  12. default
  13. {
  14.     touch_start(integer total_number)
  15.     {
  16.         float fThreshold = 0.2;
  17.         if ( is_laying_flat(fThreshold) )
  18.         {
  19.             llSay(0, "is flat");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement