#include #include #include #include using namespace std::chrono; class Pendulum; class QPainter; class QTimer; class Simulation : public QObject { public: explicit Simulation(); double size = 50; double gravity {}; double timescale {}; int substeps {}; int updateInterval = 17; bool isPlaying = false; std::vector pendula; QTimer * timer; void draw(QPainter*, int) const; public slots: void clearPendula(); private slots: void update(); private: time_point lastUpdate; };