daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest May 18th, 2018 163 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @name EYEANGLES_FIXED
  2. @inputs
  3. @outputs TrueY Y
  4. @persist
  5. @trigger
  6.  
  7. if(first()){
  8.     function number fromNorth(X){
  9.         if( (X - 90) > 0 ){
  10.             return 360 - (X - 90)  # we deduct that from 360 to change it from anti-clockwise to clockwise.
  11.         }else{                     # X - 90 is to make it start North rather than East
  12.             return 360 - (270 + X) # this is to fix the 1st "quadrant" - East to North in our original, now is 4th quadrant.
  13.         }
  14.     }
  15.     function number to360(X){
  16.         if(X >= 0){
  17.             return fromNorth(X) #as said in reddit post. from east to west it doesn't need adjustments
  18.         }else{
  19.             return fromNorth( abs(X) + (180 - abs(X))*2 ) #here's where it gets tricky, so i made something in paint:
  20.         }                                                 #https://i.imgur.com/9wAlWup.png
  21.     }
  22. }
  23.  
  24. interval(15)
  25.  
  26. Angle=owner():eyeAngles()
  27.  
  28. Y = to360(Angle:yaw())
  29. TrueY = Angle:yaw() #use the debugger to see these two values
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top