+#define TSTEP (1.0f / 30.0f)
+
+static void gupdate(void)
+{
+ if(inpstate & INP_MOVE_BITS) {
+ cgm_vec3 fwd, right;
+ float theta = cam_theta * M_PI / 180.0f;
+ float phi = cam_phi * M_PI / 180.0f;
+
+ float dx = 0, dy = 0;
+
+ fwd.x = -sin(theta) * cos(phi);
+ fwd.y = sin(phi);
+ fwd.z = cos(theta) * cos(phi);
+ right.x = cos(theta);
+ right.y = 0;
+ right.z = sin(theta);
+
+ if(inpstate & INP_FWD_BIT) {
+ dy += 0.1;
+ }
+ if(inpstate & INP_BACK_BIT) {
+ dy -= 0.1;
+ }
+ if(inpstate & INP_RIGHT_BIT) {
+ dx -= 0.1;
+ }
+ if(inpstate & INP_LEFT_BIT) {
+ dx += 0.1;
+ }
+
+ cam_pan.x += right.x * dx + fwd.x * dy;
+ cam_pan.y += fwd.y * dy;
+ cam_pan.z += right.z * dx + fwd.z * dy;
+ }
+}
+