This commit is contained in:
aozhiwei 2019-03-22 11:10:03 +08:00
parent 2751310f43
commit fd9f9e2b96
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,34 @@
#include "precompile.h"
#include "obstacle.h"
#include "metamgr.h"
#include "movement.h"
#include "room.h"
#include "collider.h"
Obstacle::Obstacle():Entity()
{
entity_type = ET_Obstacle;
}
Obstacle::~Obstacle()
{
}
void Obstacle::Initialize()
{
RecalcSelfCollider();
}
void Obstacle::RecalcSelfCollider()
{
#if 0
if (!self_collider_) {
self_collider_ = new CircleCollider();
self_collider_->owner = this;
colliders.push_back(self_collider_);
}
self_collider_->pos = Vector2D();
self_collider_->rad = gun_meta->i->bullet_rad();
#endif
}

View File

@ -0,0 +1,27 @@
#pragma once
#include "entity.h"
namespace MetaData
{
struct Player;
struct Equip;
struct MapThing;
}
class Human;
class CircleCollider;
class Obstacle : public Entity
{
public:
MetaData::MapThing* meta = nullptr;
Obstacle();
virtual ~Obstacle() override;
virtual void Initialize() override;
void RecalcSelfCollider();
private:
CircleCollider* self_collider_ = nullptr;
};