Mercurial > hg > beaglert
annotate examples/airharp/MassSpringDamper.h @ 300:dbeed520b014 prerelease
Renamed projects to examples
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 27 May 2016 13:58:20 +0100 |
parents | projects/airharp/MassSpringDamper.h@40badaff5729 |
children |
rev | line source |
---|---|
chris@164 | 1 /* |
chris@164 | 2 * |
chris@164 | 3 * Simple 1-Dimensional Mass Spring Damper |
chris@164 | 4 * |
chris@164 | 5 * Christian Heinrichs 04/2015 |
chris@164 | 6 * |
chris@164 | 7 */ |
chris@164 | 8 |
chris@164 | 9 #ifndef MASSSPRINGDAMPER_H_ |
chris@164 | 10 #define MASSSPRINGDAMPER_H_ |
chris@164 | 11 |
chris@164 | 12 class MassSpringDamper |
chris@164 | 13 { |
chris@164 | 14 |
chris@164 | 15 public: |
chris@164 | 16 |
chris@164 | 17 MassSpringDamper(float mass, float spring, float damp); |
chris@164 | 18 void setup(); |
chris@164 | 19 double update(float inForce); |
chris@164 | 20 |
chris@164 | 21 private: |
chris@164 | 22 |
chris@164 | 23 double _dt; |
chris@164 | 24 float _mass; |
chris@164 | 25 float _spring; |
chris@164 | 26 float _damp; |
chris@164 | 27 double _position; |
chris@164 | 28 double _velocity; |
chris@164 | 29 |
chris@164 | 30 }; |
chris@164 | 31 |
chris@164 | 32 #endif |