Advertisement
Guest User

Untitled

a guest
May 18th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement