shadows, textures, resource managers... shaders...
[antikythera] / src / gear.h
index 281e77f..f6058a1 100644 (file)
@@ -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,20 +65,37 @@ public:
 
        float bevel;    // bevel size
 
+       // visual surface properties
+       Vec3 color;
+       float roughness;
+       bool metallic;
+
+       Gear *supergear;
+       std::vector<Gear*> subgears;
        std::vector<GearPin> pins;
        std::vector<GearSlot> 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
 
+       Vec3 get_planar_position() const;       // 2D pos of gear on its plane
+
        void set_angle(float angle);
        float get_angle() const;
 
@@ -90,6 +107,7 @@ public:
        float get_angular_pitch() const;
 
        void draw() const;
+       void draw_wire(float line_width = 1.0f) const;
 
        bool gen_mesh();
 };