]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/p2mathlib.qc
Trim spaces
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / p2mathlib.qc
index ad569ffbc5741b235010cc7aabd873c828bbba62..85c5396d7ed72cfdba1e22494fed169e68c53450 100644 (file)
@@ -1,22 +1,22 @@
 /*
  Copyright (C) 2015 Micah Talkiewicz.
+
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
+
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
  See the GNU General Public License for more details.
+
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
+
 vector vec_bias(vector v, float f){
        vector c;
        c_x = v_x + f;
@@ -31,7 +31,7 @@ vector vec_to_min (vector a, vector b) {
        c_z = min (a_z, b_z);
        return c;
 }
+
 vector vec_to_max (vector a, vector b) {
        vector c;
        c_x = max (a_x, b_x);
@@ -39,46 +39,46 @@ vector vec_to_max (vector a, vector b) {
        c_z = max (a_z, b_z);
        return c;
 }
+
 // there may already be a function for bounding a vector in this manner, however my very quick search did not reveal one -- Player_2
 vector vec_bounds_in (vector point, vector a, vector b) {
        vector c, d, e;
-        
+
        d = vec_to_min(a,b);
        e = vec_to_max(a,b);
-        
+
        c = vec_to_max(point, d);
        c = vec_to_min(c, e);
-        
+
        return c;
-        
+
 }
+
 vector vec_bounds_out (vector point, vector a, vector b) {
        vector c, d, e;
-        
+
        d = vec_to_max(a,b);
        e = vec_to_min(a,b);
-        
+
        c = vec_to_max(point, d);
        c = vec_to_min(c, e);
-        
+
        return c;
-        
+
 }
+
 float angle_snap_f (float f, float increment){
-        
+
        float i;
        for (i = 0; i <= 360; ){
                if (f <= i - increment)
                        return  i - increment;
                i = i + increment;
        }
-        
+
        return 0;
 }
+
 vector angle_snap_vec (vector v,  float increment) {
        vector c;
        c_x = angle_snap_f (v_x, increment);