Advertisement
mew_fi

PM_CmdScale

Jan 18th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1.     private float CmdScale() {  
  2.         int max;
  3.         float total;
  4.  
  5.         max = (int)System.Math.Abs(cmd.forwardmove);
  6.         if ((int)System.Math.Abs(cmd.rightmove) > max) {
  7.             max = (int)System.Math.Abs(cmd.rightmove);
  8.         }
  9.         if ((int)System.Math.Abs(cmd.upmove) > max) {
  10.             max = (int)System.Math.Abs(cmd.upmove);
  11.         }
  12.         if (max <= 0) {
  13.             return 0;
  14.         }
  15.  
  16.         total = (float)System.Math.Abs(cmd.forwardmove * cmd.forwardmove
  17.                       + cmd.rightmove * cmd.rightmove + cmd.upmove * cmd.upmove);
  18.         scale *= 0.8f;
  19.         return scale;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement