random changes
[chaz/yoink] / src / Character.cc
index 8e5a4c65e7437ca4f80a8614a8b17c5f1c087454..accad6512ecc4e0ffc185a528bbc495b13a423f6 100644 (file)
@@ -48,8 +48,6 @@ Character::Character(const std::string& name) :
        current.recalculate();
 
        previous = current;
-
-       //updateContainers();
 }
 
 
@@ -61,28 +59,21 @@ void Character::update(Mf::Scalar t, Mf::Scalar dt)
        Mf::Scalar mag = x.length();
        Mf::Scalar d = 50.0;
 
+       // gravity:
        current.force = Mf::Vector2(0.0, -2000.0);
+       // spring:
        //current.force += -15.0 * x - 1.5 * current.velocity;
        current.force += -20.0 * (mag - d) * (x / mag) - 2.0 * current.velocity;
+       // internal:
        current.force += userForce;
        current.recalculate();
        //std::cout << "force: " << current.momentum << std::endl;
 
-       Mf::integrate<State,Derivative>(current, t, dt);
+       Mf::euler<State,Derivative>(current, t, dt);
 
        animation_.update(t, dt);
-
-       //updateContainers();
 }
 
-//void Character::updateContainers()
-//{
-       //aabb_.init(Mf::Vector3(current.position[0]-16.0, current.position[1]-16.0, z),
-                       //Mf::Vector3(current.position[0]+16.0, current.position[1]+16.0, z));
-       //sphere_.point = Mf::Vector3(current.position[0], current.position[1], z);
-       //sphere_.radius = (aabb_.min - sphere_.point).length();
-//}
-
 
 void Character::draw(Mf::Scalar alpha) const
 {
This page took 0.021455 seconds and 4 git commands to generate.