-
Notifications
You must be signed in to change notification settings - Fork 0
/
particleSystem.h
52 lines (33 loc) · 936 Bytes
/
particleSystem.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
49
50
51
52
#ifndef PARTICLESYSTEM_H
#define PARTICLESYSTEM_H
#include <vector>
#include <vecmath.h>
#include "Box.h"
#include "ForceSphere.h"
using namespace std;
class ParticleSystem
{
public:
ParticleSystem(int numParticles=0);
int m_numParticles;
// for a given state, evaluate derivative f(X,t)
virtual vector<Vector3f> evalF(vector<Vector3f> state) = 0;
// getter method for the system's state
vector<Vector3f> getState(){ return m_vVecState; };
// setter method for the system's state
void setState(const vector<Vector3f> & newState) { m_vVecState = newState; };
virtual void draw() = 0;
virtual void checkCollision() = 0;
void addForceField(Vector3f f);
void removeForceField(Vector3f f);
void print();
bool mesh;
ForceSphere* getForceSphere() {return &fsphere;}
Box getBox() {return box;}
protected:
vector<Vector3f> m_vVecState;
Vector3f m_forceField;
Box box;
ForceSphere fsphere;
};
#endif