annotate projects/airharp/MassSpringDamper.h @ 164:40badaff5729 heavy-updated

- added more pd/heavy examples - removed heavy-specific flags from Makefile - added air-harp cpp example project
author chnrx <chris.heinrichs@gmail.com>
date Thu, 03 Dec 2015 16:19:33 +0000
parents
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