Added API macros for Spaceball buttons.
[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.5f;\r
8   float sin_half = (float)sin(half_angle);\r
9 \r
10   rq.w = (float)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