human add movement
This commit is contained in:
parent
7515adebae
commit
d52daccd94
@ -15,6 +15,7 @@
|
|||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "roommgr.h"
|
#include "roommgr.h"
|
||||||
#include "android.h"
|
#include "android.h"
|
||||||
|
#include "movement.h"
|
||||||
|
|
||||||
#include "framework/cpp/utils.h"
|
#include "framework/cpp/utils.h"
|
||||||
#include "framework/cpp/httpclientpool.h"
|
#include "framework/cpp/httpclientpool.h"
|
||||||
@ -50,6 +51,8 @@ Human::Human():Entity()
|
|||||||
|
|
||||||
Human::~Human()
|
Human::~Human()
|
||||||
{
|
{
|
||||||
|
delete movement ;
|
||||||
|
movement = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Human::Initialize()
|
void Human::Initialize()
|
||||||
@ -59,6 +62,8 @@ void Human::Initialize()
|
|||||||
RecalcSelfCollider();
|
RecalcSelfCollider();
|
||||||
volume_ = meta->volume;
|
volume_ = meta->volume;
|
||||||
observers_.insert(this);
|
observers_.insert(this);
|
||||||
|
movement = new MovementComponent();
|
||||||
|
movement->owner = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Human::GetSpeed()
|
float Human::GetSpeed()
|
||||||
|
@ -30,6 +30,7 @@ enum HumanStatus
|
|||||||
struct xtimer_list;
|
struct xtimer_list;
|
||||||
class CircleCollider;
|
class CircleCollider;
|
||||||
class Obstacle;
|
class Obstacle;
|
||||||
|
class MovementComponent;
|
||||||
class Human : public Entity
|
class Human : public Entity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -219,6 +220,7 @@ protected:
|
|||||||
std::set<Human*> observers_;
|
std::set<Human*> observers_;
|
||||||
Human* follow_target_ = nullptr;
|
Human* follow_target_ = nullptr;
|
||||||
bool follow_synced_active_player = false;
|
bool follow_synced_active_player = false;
|
||||||
|
MovementComponent* movement = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CircleCollider* self_collider_ = nullptr;
|
CircleCollider* self_collider_ = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user