Simulate thousands of n-Pendula (up to 32) with Position Based Dynamics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
396 B

#include <vector>
#include <QVector2D>
#include <QColor>
#include "Vector.h"
class QPainter;
1 year ago
class Pendulum {
public:
explicit Pendulum(const std::vector<double> &M,
const std::vector<double> &L,
QColor color, double startAngle);
void draw(QPainter*, double) const;
1 year ago
void update(double, double);
1 year ago
private:
std::vector<Vector> X, V;
std::vector<double> M, L;
QColor color;
1 year ago
};