projects
/
antikythera
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- added subgear linkage
[antikythera]
/
src
/
machine.h
diff --git
a/src/machine.h
b/src/machine.h
index
f222cd7
..
e0f2155
100644
(file)
--- a/
src/machine.h
+++ b/
src/machine.h
@@
-2,6
+2,7
@@
#define MACHINE_H_
#include <vector>
#define MACHINE_H_
#include <vector>
+#include <map>
#include "gear.h"
struct Motor {
#include "gear.h"
struct Motor {
@@
-12,7
+13,9
@@
struct Motor {
class Machine {
private:
std::vector<Gear*> gears;
class Machine {
private:
std::vector<Gear*> gears;
+ std::map<Gear*, int> gearidx;
bool **meshing;
bool **meshing;
+ bool meshing_valid;
bool *visited; /* used for update_gear */
std::vector<Motor> motors;
bool *visited; /* used for update_gear */
std::vector<Motor> motors;
@@
-26,10
+29,13
@@
public:
void add_gear(Gear *g); /* takes ownership */
void add_motor(int gearidx, float speed_hz);
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;
void calc_meshing();
void update(float dt);
void draw() const;
+
+ Gear *intersect_gear(const Ray &ray, HitPoint *hitp = 0) const;
};
#endif // MACHINE_H_
};
#endif // MACHINE_H_