#define GEAR_H_
#include <vector>
+#include <string>
#include <gmath/gmath.h>
#include "mesh.h"
float contour(float u);
public:
+ std::string name;
Vec3 pos, axis; /* implicitly defines a plane eqn. */
float pdist; /* derived: distance of plane from origin */
+ float init_angle; /* initial starting angle */
float angle; /* current angle of the gear */
int nteeth; /* number of teeth */
Gear();
~Gear();
+ // sets the supplied number of teeth, and calculates the radius
+ // of the gear, to achieve the required tooth pitch
+ void set_teeth(int nt, float tooth_pitch);
+
+ float get_rotation() const;
+
+ // returns the angle (in radians) from one tooth to the next
+ float get_angular_pitch() const;
+
void draw() const;
bool gen_mesh();