]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/vector.qh
Viewmodels: cl_bobmodel: check onground for other players too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / vector.qh
index de32d206f3b1f40235498f1914c7db66e2e6fd3c..9813f2fa92d54b9ef2ccb9c1465e2d1e4c0eef3b 100644 (file)
@@ -47,6 +47,16 @@ float boxesoverlap(vector m1, vector m2, vector m3, vector m4) { return m2_x >=
 /** requires the same as boxesoverlap, but is a stronger condition */
 float boxinsidebox(vector smins, vector smaxs, vector bmins, vector bmaxs) { return smins.x >= bmins.x && smaxs.x <= bmaxs.x && smins.y >= bmins.y && smaxs.y <= bmaxs.y && smins.z >= bmins.z && smaxs.z <= bmaxs.z; }
 
+#define PITCH(v) (v).x
+#define YAW(v) (v).y
+#define ROLL(v) (v).z
+
+#define MAKEVECTORS(f, angles, forward, right, up) do { \
+       f(angles); \
+       forward = v_forward; \
+       right = v_right; \
+       up = v_up; \
+} while (0)
 
 vector vec2(vector v)
 {
@@ -63,6 +73,21 @@ vector vec3(float x, float y, float z)
        return v;
 }
 
+vector rotate(vector v, float a)
+{
+       float a_sin = sin(a), a_cos = cos(a);
+       vector r = '0 0 0';
+       r.x =      v.x * a_cos + v.y * a_sin;
+       r.y = -1 * v.x * a_sin + v.y * a_cos;
+       return r;
+}
+
+vector yinvert(vector v)
+{
+       v.y = 1 - v.y;
+       return v;
+}
+
 #ifndef MENUQC
        vector get_corner_position(entity box, int corner)
        {