Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private float CmdScale() {
- int max;
- float total;
- max = (int)System.Math.Abs(cmd.forwardmove);
- if ((int)System.Math.Abs(cmd.rightmove) > max) {
- max = (int)System.Math.Abs(cmd.rightmove);
- }
- if ((int)System.Math.Abs(cmd.upmove) > max) {
- max = (int)System.Math.Abs(cmd.upmove);
- }
- if (max <= 0) {
- return 0;
- }
- total = (float)System.Math.Abs(cmd.forwardmove * cmd.forwardmove
- + cmd.rightmove * cmd.rightmove + cmd.upmove * cmd.upmove);
- scale *= 0.8f;
- return scale;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement