Mercurial > hg > beaglert
comparison examples/10-Instruments/airharp/MassSpringDamper.h @ 464:8fcfbfb32aa0 prerelease
Examples reorder with subdirectories. Added header to each project. Moved Doxygen to bottom of render.cpp.
author | Robert Jack <robert.h.jack@gmail.com> |
---|---|
date | Mon, 20 Jun 2016 16:20:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
463:c47709e8b5c9 | 464:8fcfbfb32aa0 |
---|---|
1 /* | |
2 * | |
3 * Simple 1-Dimensional Mass Spring Damper | |
4 * | |
5 * Christian Heinrichs 04/2015 | |
6 * | |
7 */ | |
8 | |
9 #ifndef MASSSPRINGDAMPER_H_ | |
10 #define MASSSPRINGDAMPER_H_ | |
11 | |
12 class MassSpringDamper | |
13 { | |
14 | |
15 public: | |
16 | |
17 MassSpringDamper(float mass, float spring, float damp); | |
18 void setup(); | |
19 double update(float inForce); | |
20 | |
21 private: | |
22 | |
23 double _dt; | |
24 float _mass; | |
25 float _spring; | |
26 float _damp; | |
27 double _position; | |
28 double _velocity; | |
29 | |
30 }; | |
31 | |
32 #endif |