-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParticleSimulator.h
48 lines (41 loc) · 1005 Bytes
/
ParticleSimulator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <GLModel/GLModel.h>
#include <shared/defs.h>
#include <util/util.h>
#include "animTcl.h"
#include "BaseSimulator.h"
#include "BaseSystem.h"
#include "ParticleSystem.h"
#include <string>
#include "BaseSimulator.h"
#include "Spring.h"
#include <glm/geometric.hpp>
class ParticleSimulator :
public BaseSimulator
{
public:
ParticleSimulator(const std::string& name);
int init(double time)
{
return 0;
}
void updateSpringForces();
// Integrators
void integrateEuler(double dt);
void integrateSymplectic(double accuracyStep);
void integrateVerlet(double accuracyStep);
int command(int argc, myCONST_SPEC char** argv);
int step(double time);
void display(GLenum mode = GL_RENDER);
protected:
ParticleSystem* particleSys;
std::vector <Spring> springs;
double gravity=0;
double kDrag=0;
double ksGround=0;
double kdGround=0;
double accuracyStep=0;
bool euler=false;
bool symplectic=false;
bool verlet=false;
};