-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpringDamper.h
More file actions
41 lines (30 loc) · 811 Bytes
/
SpringDamper.h
File metadata and controls
41 lines (30 loc) · 811 Bytes
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
#ifndef SPRINGDAMPER_H
#define SPRINGDAMPER_H
class Particle;
class SpringDamper
{
public:
SpringDamper();
virtual ~SpringDamper();
float springConstant() const;
void setSpringConstant(float springConstant);
float dampingFactor() const;
void setDampingFactor(float dampingFactor);
float restLength() const;
void setRestLength(float restLength);
Particle* p1() const;
void setP1(Particle* p1);
Particle* p2() const;
void setP2(Particle* p2);
void computeForces();
int idx() const;
void setIdx(int idx);
private:
float _springConstant;
float _dampingFactor;
float _restLength;
Particle* _p1;
Particle* _p2;
int _idx;
};
#endif // SPRINGDAMPER_H