annotate examples/10-Instruments/airharp/MassSpringDamper.h @ 556:ce391098f321 prerelease tip

THIS PROJECT HAS MOVED TO https://github.com/BelaPlatform/bela
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 25 Jun 2016 20:21:00 +0100
parents 8fcfbfb32aa0
children
rev   line source
robert@464 1 /*
robert@464 2 *
robert@464 3 * Simple 1-Dimensional Mass Spring Damper
robert@464 4 *
robert@464 5 * Christian Heinrichs 04/2015
robert@464 6 *
robert@464 7 */
robert@464 8
robert@464 9 #ifndef MASSSPRINGDAMPER_H_
robert@464 10 #define MASSSPRINGDAMPER_H_
robert@464 11
robert@464 12 class MassSpringDamper
robert@464 13 {
robert@464 14
robert@464 15 public:
robert@464 16
robert@464 17 MassSpringDamper(float mass, float spring, float damp);
robert@464 18 void setup();
robert@464 19 double update(float inForce);
robert@464 20
robert@464 21 private:
robert@464 22
robert@464 23 double _dt;
robert@464 24 float _mass;
robert@464 25 float _spring;
robert@464 26 float _damp;
robert@464 27 double _position;
robert@464 28 double _velocity;
robert@464 29
robert@464 30 };
robert@464 31
robert@464 32 #endif