X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=antikythera;a=blobdiff_plain;f=src%2Fmachine.h;h=e0f2155b389906b157205ac62730594af468789f;hp=f222cd78ec6a2e274dd38b636169d393c289722a;hb=080d7a779d43f549fc16c44e709cbf5989180fdf;hpb=a88a9ac53952e1bb3768b147a043c19392e3d5d1 diff --git a/src/machine.h b/src/machine.h index f222cd7..e0f2155 100644 --- a/src/machine.h +++ b/src/machine.h @@ -2,6 +2,7 @@ #define MACHINE_H_ #include +#include #include "gear.h" struct Motor { @@ -12,7 +13,9 @@ struct Motor { class Machine { private: std::vector gears; + std::map gearidx; bool **meshing; + bool meshing_valid; bool *visited; /* used for update_gear */ std::vector motors; @@ -26,10 +29,13 @@ public: void add_gear(Gear *g); /* takes ownership */ void add_motor(int gearidx, float speed_hz); + 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_