Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/freeglut/progs/demos/spaceball/vmath.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 #ifndef VMATH_H_ | |
| 2 #define VMATH_H_ | |
| 3 | |
| 4 #if defined(WIN32) | |
| 5 #define INLINE | |
| 6 #else | |
| 7 #define INLINE inline | |
| 8 #endif | |
| 9 | |
| 10 | |
| 11 typedef struct { float x, y, z; } vec3_t; | |
| 12 typedef struct { float x, y, z, w; } vec4_t; | |
| 13 | |
| 14 typedef vec4_t quat_t; | |
| 15 | |
| 16 typedef float mat4_t[4][4]; | |
| 17 | |
| 18 /* vector functions */ | |
| 19 static INLINE vec3_t v3_cons(float x, float y, float z); | |
| 20 static INLINE float v3_dot(vec3_t v1, vec3_t v2); | |
| 21 | |
| 22 /* quaternion functions */ | |
| 23 static INLINE quat_t quat_cons(float s, float x, float y, float z); | |
| 24 static INLINE vec3_t quat_vec(quat_t q); | |
| 25 static INLINE quat_t quat_mul(quat_t q1, quat_t q2); | |
| 26 static INLINE void quat_to_mat(mat4_t res, quat_t q); | |
| 27 quat_t quat_rotate(quat_t q, float angle, float x, float y, float z); | |
| 28 | |
| 29 /* matrix functions */ | |
| 30 static INLINE void m4_cons(mat4_t m, | |
| 31 float m11, float m12, float m13, float m14, | |
| 32 float m21, float m22, float m23, float m24, | |
| 33 float m31, float m32, float m33, float m34, | |
| 34 float m41, float m42, float m43, float m44); | |
| 35 | |
| 36 #include "vmath.inl" | |
| 37 | |
| 38 #endif /* VMATH_H_ */ |
