+++ /dev/null
-#ifndef MACHINE_H_
-#define MACHINE_H_
-
-#include <vector>
-#include <map>
-#include "gear.h"
-
-struct Motor {
- float speed; /* signed to denote direction, in Hz */
- int drive; /* which gear it drives */
-};
-
-class Machine {
-private:
- std::vector<Gear*> gears;
- std::map<Gear*, int> gearidx;
- bool **meshing;
- bool meshing_valid;
- bool *visited; /* used for update_gear */
-
- std::vector<Motor> motors;
-
- void update_gear(int idx, float angle);
-
-public:
- Machine();
- ~Machine();
-
- void add_gear(Gear *g); /* takes ownership */
- void add_motor(int gearidx, float speed_hz);
-
- int get_gear_index(Gear *g) const;
-
- void invalidate_meshing();
- void calc_meshing();
-
- void update(float dt);
- void draw() const;
-
- Gear *intersect_gear(const Ray &ray, HitPoint *hitp = 0) const;
-};
-
-#endif // MACHINE_H_