]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - matrixlib.h
Deduct frame execution time from sleep time
[xonotic/darkplaces.git] / matrixlib.h
index 232f1add4a506040dbf5b1cd3a858a48ca0d7b0a..bfae8c47a3b335605bd694e105a695abbc51c2c5 100644 (file)
@@ -2,9 +2,7 @@
 #ifndef MATRIXLIB_H
 #define MATRIXLIB_H
 
-#ifndef M_PI
-#define M_PI           3.14159265358979323846  // matches value in gcc v2 math.h
-#endif
+#include "qtypes.h"
 
 //#define MATRIX4x4_OPENGLORIENTATION
 
@@ -80,6 +78,8 @@ void Matrix4x4_CreateScale (matrix4x4_t *out, double x);
 void Matrix4x4_CreateScale3 (matrix4x4_t *out, double x, double y, double z);
 // creates a matrix for a quake entity
 void Matrix4x4_CreateFromQuakeEntity(matrix4x4_t *out, double x, double y, double z, double pitch, double yaw, double roll, double scale);
+// creates a duke3d view matrix for a quake view matrix ;)
+void Matrix4x4_QuakeToDuke3D(const matrix4x4_t *in, matrix4x4_t *out, double maxShearAngle);
 
 // converts a matrix4x4 to a set of 3D vectors for the 3 axial directions, and the translate
 void Matrix4x4_ToVectors(const matrix4x4_t *in, vec_t vx[3], vec_t vy[3], vec_t vz[3], vec_t t[3]);
@@ -93,7 +93,7 @@ void Matrix4x4_FromArrayDoubleGL(matrix4x4_t *out, const double in[16]);
 // converts a matrix4x4 to a double[16] array in the Direct3D orientation
 void Matrix4x4_ToArrayDoubleD3D(const matrix4x4_t *in, double out[16]);
 // creates a matrix4x4 from a double[16] array in the Direct3D orientation
-void Matrix4x4_FromArrayDoubleD3D(matrix4x4_t *out, const double in[16]);
+void Matrix4x4_FromArrayDoubleD3D(matrix4x4_t *out, const double in[4][4]);
 
 // converts a matrix4x4 to a float[16] array in the OpenGL orientation
 void Matrix4x4_ToArrayFloatGL(const matrix4x4_t *in, float out[16]);
@@ -105,7 +105,7 @@ void Matrix4x4_ToArrayFloatD3D(const matrix4x4_t *in, float out[16]);
 void Matrix4x4_FromArrayFloatD3D(matrix4x4_t *out, const float in[16]);
 
 // converts a matrix4x4 to a float[12] array in the OpenGL orientation
-void Matrix4x4_ToArray12FloatGL(const matrix4x4_t *in, float out[12]);
+void Matrix4x4_ToArray12FloatGL(const matrix4x4_t *in, float out[4][3]);
 // creates a matrix4x4 from a float[12] array in the OpenGL orientation
 void Matrix4x4_FromArray12FloatGL(matrix4x4_t *out, const float in[12]);
 // converts a matrix4x4 to a float[12] array in the Direct3D orientation