human add movement

This commit is contained in:
aozhiwei 2019-06-07 22:59:32 +08:00
parent 7515adebae
commit d52daccd94
2 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include "app.h"
#include "roommgr.h"
#include "android.h"
#include "movement.h"
#include "framework/cpp/utils.h"
#include "framework/cpp/httpclientpool.h"
@ -50,6 +51,8 @@ Human::Human():Entity()
Human::~Human()
{
delete movement ;
movement = nullptr;
}
void Human::Initialize()
@ -59,6 +62,8 @@ void Human::Initialize()
RecalcSelfCollider();
volume_ = meta->volume;
observers_.insert(this);
movement = new MovementComponent();
movement->owner = this;
}
float Human::GetSpeed()

View File

@ -30,6 +30,7 @@ enum HumanStatus
struct xtimer_list;
class CircleCollider;
class Obstacle;
class MovementComponent;
class Human : public Entity
{
public:
@ -219,6 +220,7 @@ protected:
std::set<Human*> observers_;
Human* follow_target_ = nullptr;
bool follow_synced_active_player = false;
MovementComponent* movement = nullptr;
private:
CircleCollider* self_collider_ = nullptr;