First attempt at adding John Tsiombikas' spaceball support for X11. It compiles...
[freeglut] / progs / demos / spaceball / vmath.c
1 #include <math.h>\r
2 #include "vmath.h"\r
3 \r
4 quat_t quat_rotate(quat_t q, float angle, float x, float y, float z)\r
5 {\r
6         quat_t rq;\r
7         float half_angle = angle * 0.5;\r
8         float sin_half = sin(half_angle);\r
9 \r
10         rq.w = cos(half_angle);\r
11         rq.x = x * sin_half;\r
12         rq.y = y * sin_half;\r
13         rq.z = z * sin_half;\r
14 \r
15         return quat_mul(q, rq);\r
16 }\r