+static void update(float dt)
+{
+ Vec3 dir;
+
+ if(keystate['D'])
+ dir.x += cow_speed * dt;
+ if(keystate['A'])
+ dir.x -= cow_speed * dt;
+ if(keystate['W'])
+ dir.z -= cow_speed * dt;
+ if(keystate['S'])
+ dir.z += cow_speed * dt;
+
+ Vec3 *pos = move_camera ? &cam_pos : &cow_pos;
+ float theta = cam_theta / 180.0 * M_PI;
+ pos->x += dir.x * cos(theta) - dir.z * sin(theta);
+ pos->z += dir.x * sin(theta) + dir.z * cos(theta);
+}
+