]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util.qc
Merge branch 'master' into terencehill/music_player
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util.qc
index d668a384c30984c3c2038579e8944428778e8a31..671c8d5a593e23f9c552a700172cc57b9cf7139c 100644 (file)
@@ -1719,19 +1719,6 @@ vector get_shotvelocity(vector myvel, vector mydir, float spd, float newton_styl
        return myvel + spd * mydir;
 }
 
-void check_unacceptable_compiler_bugs()
-{
-       if(cvar("_allow_unacceptable_compiler_bugs"))
-               return;
-       tokenize_console("foo bar");
-       if(strcat(argv(0), substring("foo bar", 4, 7 - argv_start_index(1))) == "barbar")
-               error("fteqcc bug introduced with revision 3178 detected. Please upgrade fteqcc to a later revision, downgrade fteqcc to revision 3177, or pester Spike until he fixes it. You can set _allow_unacceptable_compiler_bugs 1 to skip this check, but expect stuff to be horribly broken then.");
-
-       string s = "";
-       if (!s)
-               error("The empty string counts as false. We do not want that!");
-}
-
 float compressShotOrigin(vector v)
 {
        float x, y, z;
@@ -2122,6 +2109,8 @@ float get_model_parameters(string m, float sk)
                        get_model_parameters_weight = stof(s);
                if(c == "age")
                        get_model_parameters_age = stof(s);
+               if(c == "description")
+                       get_model_parameters_description = s;
                if(c == "bone_upperbody")
                        get_model_parameters_bone_upperbody = s;
                if(c == "bone_weapon")
@@ -2574,6 +2563,30 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
                queue_start.FindConnectedComponent_processing = 0;
 }
 
+#ifdef SVQC
+vector combine_to_vector(float x, float y, float z)
+{
+       vector result; result_x = x; result_y = y; result_z = z;
+       return result;
+}
+
+vector get_corner_position(entity box, float corner)
+{
+       switch(corner)
+       {
+               case 1: return combine_to_vector(box.absmin_x, box.absmin_y, box.absmin_z);
+               case 2: return combine_to_vector(box.absmax_x, box.absmin_y, box.absmin_z);
+               case 3: return combine_to_vector(box.absmin_x, box.absmax_y, box.absmin_z);
+               case 4: return combine_to_vector(box.absmin_x, box.absmin_y, box.absmax_z);
+               case 5: return combine_to_vector(box.absmax_x, box.absmax_y, box.absmin_z);
+               case 6: return combine_to_vector(box.absmin_x, box.absmax_y, box.absmax_z);
+               case 7: return combine_to_vector(box.absmax_x, box.absmin_y, box.absmax_z);
+               case 8: return combine_to_vector(box.absmax_x, box.absmax_y, box.absmax_z);
+               default: return '0 0 0';
+       }
+}
+#endif
+
 // todo: this sucks, lets find a better way to do backtraces?
 void backtrace(string msg)
 {
@@ -2803,3 +2816,18 @@ float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents)
        return CONTENT_EMPTY;
 }
 #endif
+
+vector bezier_quadratic_getpoint(vector a, vector b, vector c, float t)
+{
+       return
+               (c - 2 * b + a) * (t * t) +
+               (b - a) * (2 * t) +
+               a;
+}
+
+vector bezier_quadratic_getderivative(vector a, vector b, vector c, float t)
+{
+       return
+               (c - 2 * b + a) * (2 * t) +
+               (b - a) * 2;
+}