chris@164: /* chris@164: * chris@164: * Simple 1-Dimensional Mass Spring Damper chris@164: * chris@164: * Christian Heinrichs 04/2015 chris@164: * chris@164: */ chris@164: chris@164: #ifndef MASSSPRINGDAMPER_H_ chris@164: #define MASSSPRINGDAMPER_H_ chris@164: chris@164: class MassSpringDamper chris@164: { chris@164: chris@164: public: chris@164: chris@164: MassSpringDamper(float mass, float spring, float damp); chris@164: void setup(); chris@164: double update(float inForce); chris@164: chris@164: private: chris@164: chris@164: double _dt; chris@164: float _mass; chris@164: float _spring; chris@164: float _damp; chris@164: double _position; chris@164: double _velocity; chris@164: chris@164: }; chris@164: chris@164: #endif