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