-/*] Copyright (c) 2009-2010, Charles McGarvey [**************************
+/*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
**] All rights reserved.
*
-* vi:ts=4 sw=4 tw=75
-*
* Distributable under the terms and conditions of the 2-clause BSD license;
* see the file COPYING for a complete text of the license.
*
-**************************************************************************/
+*****************************************************************************/
#include <iostream>
moof::vector2 location;
};
+
class ResistanceForce
{
public:
// forces
state_.force = moof::vector2(0.0, 0.0);
- state_.forces.push_back(SpringForce(moof::vector2(5.0, 4.0)));
- state_.forces.push_back(ResistanceForce(2.0));
- state_.forces.push_back(moof::linear_state<2>::gravity_force(-9.8));
+ //state_.forces.push_back(SpringForce(moof::vector2(5.0, 4.0)));
+ //state_.forces.push_back(ResistanceForce(2.0));
+ //state_.forces.push_back(moof::linear_state<2>::gravity_force(-9.8));
// starting position
state_.position = moof::vector2(5.0, 5.0);
- state_.momentum = moof::vector2(1.0, 0.0);
+ state_.momentum = moof::vector2(3.0, 0.0);
state_.recalculate();
prev_state_ = state_;
}
-
void Character::update(moof::scalar t, moof::scalar dt)
{
moof::rigid_body2::update(t, dt); // update physics
tilemap.tile(frame);
}
-
void Character::draw(moof::scalar alpha) const
{
moof::state2 state = moof::rigid_body2::state(alpha);
tilemap.draw(coords);
}
-
/*int Character::getOctant(const moof::Aabb<3>& aabb) const
{
int octantNum = -1;
}
*/
-
void Character::addImpulse(moof::vector2 impulse)
{
state_.momentum += impulse;