/* Project: coevolutionary GP moto driving Dana Vrajitoru general.h Some functions that don't fit anywhere else. */ #include "general.h" // Add the speed to the angle and make sure that they are within the // range 0 to 360. void update_angle(GLfloat &angle, GLfloat &speed) { angle += speed; while (angle < 0) angle += 360; while (angle >= 360) angle -= 360; } // Set the coordinates of a point with given values, 0 by default. void set_point3f(Point3f point, GLfloat x = 0.0, GLfloat y = 0.0, GLfloat z = 0.0) { point[0] = x; point[1] = y; point[2] = z; } // Rotate by a Point3f. void rotate_point(Point3f v) { glRotatef(v[0], 1, 0, 0); glRotatef(v[1], 0, 1, 0); glRotatef(v[2], 0, 0, 1); }