X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FCharacter.hh;h=28e588b627da8ccc0b45b49dc80cbac1b37fc258;hp=19559f38b0f54be1643f31fc29f2949323be977b;hb=2fdb5f5824826a6c54f5afde8c62eafd24c1a152;hpb=bc2bc12125d6c223d2935557e01926fe21166e38 diff --git a/src/Character.hh b/src/Character.hh index 19559f3..28e588b 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -31,16 +31,19 @@ #include +#include #include #include -#include +#include +#include +#include #include "Animation.hh" #include "Tilemap.hh" -struct Character; +class Character; typedef boost::shared_ptr CharacterP; @@ -49,12 +52,8 @@ typedef boost::shared_ptr CharacterP; * includes the heroine herself and the bad guys. */ -struct Character : public Mf::Entity +class Character : public Mf::RigidBody2, public Mf::OctreeInsertable { -protected: - - Mf::Vector2 userForce; - public: Character(const std::string& name); @@ -63,9 +62,20 @@ public: virtual void update(Mf::Scalar t, Mf::Scalar dt); virtual void draw(Mf::Scalar alpha) const; + void setZCoord(Mf::Scalar z); + + void addImpulse(Mf::Vector2 impulse); + void addForce(Mf::Vector2 force); + void setPosition(Mf::Vector2 position); + + virtual int getOctant(const Mf::Aabb& aabb) const; Tilemap tilemap; Animation animation; + +private: + + mutable Mf::Scalar mZCoord; };