X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FCharacter.hh;h=28e588b627da8ccc0b45b49dc80cbac1b37fc258;hp=50c3da51a6418582569a88145be462acc5b017d6;hb=2fdb5f5824826a6c54f5afde8c62eafd24c1a152;hpb=64bd443538f57ad1bdff6c6b35953e72141129b2 diff --git a/src/Character.hh b/src/Character.hh index 50c3da5..28e588b 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include "Animation.hh" @@ -43,7 +43,7 @@ -struct Character; +class Character; typedef boost::shared_ptr CharacterP; @@ -52,12 +52,8 @@ typedef boost::shared_ptr 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); @@ -66,21 +62,20 @@ public: 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; };