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.
 
 
 
 

24 lines
455 B

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