Mercurial > hg > beaglert
annotate examples/airharp/MassSpringDamper.h @ 330:276a8517da13 prerelease
build_project now updates the date of the files on the bbb
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sat, 04 Jun 2016 15:23:52 +0100 |
parents | dbeed520b014 |
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 |