+struct SpringForce
+{
+ explicit SpringForce(Mf::Vector2 x) :
+ location(x) {}
+
+ const Mf::Vector2& operator () (const Mf::LinearState<2>& state)
+ {
+ Mf::Vector2 x = state.position - location;
+ Mf::Scalar mag = x.length();
+ Mf::Scalar d = 50.0;
+
+ // spring:
+ //current.force += -15.0 * x - 1.5 * current.velocity;
+ force = -20.0 * (mag - d) * (x / mag) - 2.0 * state.velocity;
+
+ return force;
+ }
+
+private:
+
+ Mf::Vector2 force;
+ Mf::Vector2 location;
+};
+
+struct WindResistenceForce
+{
+ const Mf::Vector2& operator () (const Mf::LinearState<2>& state)
+ {
+ force = -2.0 * state.velocity;
+ return force;
+ }
+
+private:
+
+ Mf::Vector2 force;
+};
+
+