-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpring.h
More file actions
32 lines (22 loc) · 684 Bytes
/
Spring.h
File metadata and controls
32 lines (22 loc) · 684 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
#ifndef SPRING_H
#define SPRING_H
#include "Util.h"
class Particle;
class Spring
{
public:
Spring();
void SetParticles(Particle* New1, Particle* New2);
void SetRestLength(float NewLength) { RestLength = NewLength; }
void SetCoefficient(float NewCoef) { Coefficient = NewCoef; }
void GetParticles(Particle*& First, Particle*& Second) { First = p1; Second = p2; }
float GetRestLength() const { return RestLength; }
float GetCoefficient() const { return Coefficient; }
uint2 GetIds() { return make_uint2(p1->GetId(), p2->GetId()); }
private:
Particle* p1;
Particle* p2;
float RestLength;
float Coefficient;
};
#endif // SPRING_H