X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=antikythera;a=blobdiff_plain;f=src%2Fgear.h;h=f6058a10a7f4590af3a6780c4e9f23dabcc7cbf4;hp=45a3d13f551f3b8cf0fb73feb3b8eef813e3249e;hb=ccc1a688b59e25bb934a0d3e2bbf477960068d4f;hpb=014fccdee30291407985658e8cefd9be7dc9e9fa diff --git a/src/gear.h b/src/gear.h index 45a3d13..f6058a1 100644 --- a/src/gear.h +++ b/src/gear.h @@ -39,7 +39,7 @@ class Gear { private: Mesh *mesh; - mutable Mat4 xform, dir_xform; + mutable Mat4 xform, dir_xform, axel_xform; mutable bool xform_valid; void calc_matrix() const; @@ -65,16 +65,31 @@ public: float bevel; // bevel size + // visual surface properties + Vec3 color; + float roughness; + bool metallic; + + Gear *supergear; + std::vector subgears; std::vector pins; std::vector slots; Gear(); ~Gear(); + void attach(Gear *g); + bool detach(Gear *g); + Gear *get_super() const; + + void set_angular_offset(float offs); + float get_angular_offset() const; + // 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); void set_axis(const Vec3 &axis); + const Vec3 &get_axis() const; void set_position(const Vec3 &pos); const Vec3 &get_position() const; Vec3 get_global_position() const; // taking parent gear into account