#include <Moof/Entity.hh>
#include <Moof/Math.hh>
#include <Moof/Octree.hh>
-#include <Moof/Physics.hh>
+#include <Moof/RigidBody.hh>
#include <Moof/Sphere.hh>
#include "Animation.hh"
-struct Character;
+class Character;
typedef boost::shared_ptr<Character> CharacterP;
* includes the heroine herself and the bad guys.
*/
-struct Character : public Mf::Entity, public Mf::OctreeInsertable
+class Character : public Mf::RigidBody2, public Mf::OctreeInsertable
{
-protected:
-
- Mf::Vector2 userForce;
-
public:
Character(const std::string& name);
virtual void update(Mf::Scalar t, Mf::Scalar dt);
virtual void draw(Mf::Scalar alpha) const;
- virtual bool isInsideAabb(const Mf::Aabb& aabb) const;
- virtual int getOctant(const Mf::Aabb& aabb) const;
+ void setZCoord(Mf::Scalar z);
- Mf::State2 previous;
- Mf::State2 current;
+ void addImpulse(Mf::Vector2 impulse);
+ void addForce(Mf::Vector2 force);
+ void setPosition(Mf::Vector2 position);
- Tilemap tilemap;
- Animation animation;
+ virtual int getOctant(const Mf::Aabb& aabb) const;
- Mf::Aabb aabb_;
- Mf::Sphere sphere_;
+ Tilemap tilemap;
+ Animation animation;
private:
- static const Mf::Scalar z = 96.0;
+ mutable Mf::Scalar mZCoord;
};