]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mathlib.c
now counts (very approximate) cost of builtin functions called by progs, profile...
[xonotic/darkplaces.git] / mathlib.c
index 96090b50b49ff49fc2a49481862fb26d3c157c46..4dea77d59d066b15b7b57600ebe6c74c62905cbd 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -31,7 +31,7 @@ float m_bytenormals[NUMVERTEXNORMALS][3] =
 {
 {-0.525731, 0.000000, 0.850651}, {-0.442863, 0.238856, 0.864188}, 
 {-0.295242, 0.000000, 0.955423}, {-0.309017, 0.500000, 0.809017}, 
-{-0.162460, 0.262866, 0.951056}, {0.000000, 0.000000, 1.000000}, 
+{-0.162460, 0.262866, 0.951056}, {0.000000, 0.000000, 1.000000},
 {0.000000, 0.850651, 0.525731}, {-0.147621, 0.716567, 0.681718}, 
 {0.147621, 0.716567, 0.681718}, {0.000000, 0.525731, 0.850651}, 
 {0.309017, 0.500000, 0.809017}, {0.525731, 0.000000, 0.850651}, 
@@ -64,7 +64,7 @@ float m_bytenormals[NUMVERTEXNORMALS][3] =
 {0.525731, 0.000000, -0.850651}, {0.681718, 0.147621, -0.716567}, 
 {0.681718, -0.147621, -0.716567}, {0.850651, 0.000000, -0.525731},
 {0.809017, -0.309017, -0.500000}, {0.864188, -0.442863, -0.238856}, 
-{0.951056, -0.162460, -0.262866}, {0.147621, 0.716567, -0.681718}, 
+{0.951056, -0.162460, -0.262866}, {0.147621, 0.716567, -0.681718},
 {0.309017, 0.500000, -0.809017}, {0.425325, 0.688191, -0.587785}, 
 {0.442863, 0.238856, -0.864188}, {0.587785, 0.425325, -0.688191}, 
 {0.688191, 0.587785, -0.425325}, {-0.147621, 0.716567, -0.681718}, 
@@ -244,14 +244,9 @@ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
        vec3_t vr, vu, vf;
 
        angle = DEG2RAD(degrees);
-
        c = cos(angle);
        s = sin(angle);
-
-       vf[0] = dir[0];
-       vf[1] = dir[1];
-       vf[2] = dir[2];
-
+       VectorCopy(dir, vf);
        VectorVectors(vf, vr, vu);
 
        t0 = vr[0] *  c + vu[0] * -s;
@@ -498,3 +493,13 @@ void Mathlib_Init(void)
                ixtable[a] = 1.0f / a;
 }
 
+#include "matrixlib.h"
+
+void Matrix4x4_Print (const matrix4x4_t *in)
+{
+       Con_Printf("%f %f %f %f\n%f %f %f %f\n%f %f %f %f\n%f %f %f %f\n"
+       , in->m[0][0], in->m[0][1], in->m[0][2], in->m[0][3]
+       , in->m[1][0], in->m[1][1], in->m[1][2], in->m[1][3]
+       , in->m[2][0], in->m[2][1], in->m[2][2], in->m[2][3]
+       , in->m[3][0], in->m[3][1], in->m[3][2], in->m[3][3]);
+}