Guest User

Untitled

a guest
Jul 18th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. if (this.currentAangle < this.targetAngle)
  2. {
  3. if((this.currentAangle + this.rotatingAngle)> this.targetAngle)
  4. {
  5. this.currentAangle = this.targetAngle;
  6. }
  7. else
  8. {
  9. this.currentAangle += this.rotatingAngle;
  10. }
  11. }
  12. else
  13. {
  14. if ((this.currentAangle - this.rotatingAngle) < this.targetAngle)
  15. {
  16. this.currentAangle = this.targetAngle;
  17. }
  18. else
  19. {
  20. this.currentAangle -= this.rotatingAngle;
  21. }
  22. }
  23.  
  24. if (Math.Sign(this.targetAngle) != Math.Sign(this.currentAangle) && Math.Abs(this.targetAngle)>2)
  25. {
  26. Signum = -1;
  27. }
  28.  
  29. if (this.currentAangle < this.targetAngle * Signum)
  30. {
  31. if((this.currentAangle + this.rotatingAngle)> this.targetAngle)
  32. {
  33. this.currentAangle = this.targetAngle;
  34. }
  35. else
  36. {
  37. this.currentAangle += this.rotatingAngle;
  38. }
  39. }
  40. else
  41. {
  42. if ((this.currentAangle - this.rotatingAngle) < this.targetAngle)
  43. {
  44.  
  45. this.currentAangle = this.targetAngle;
  46. }
  47. else
  48. {
  49. this.currentAangle -= this.rotatingAngle;
  50. }
  51. }
Add Comment
Please, Sign In to add comment