This commit is contained in:
aozhiwei 2019-06-07 22:32:47 +08:00
parent b52ba4ee77
commit 7515adebae
5 changed files with 8 additions and 9 deletions

View File

@ -50,13 +50,6 @@ void Bullet::RecalcSelfCollider()
self_collider_->rad = gun_meta->i->bullet_rad();
}
#ifdef RAY_DETECTION
void Bullet::RayDetection()
{
}
#endif
void Bullet::OnHit(std::set<Entity*>& objects)
{
for (auto& target : objects) {

View File

@ -31,7 +31,6 @@ class Bullet : public Entity
virtual void Initialize() override;
virtual void Update(int delta_time) override;
void RecalcSelfCollider();
void RayDetection();
void ClearRayData();
private:

View File

@ -2,6 +2,11 @@
#include "movement.h"
void MovementComponent::RayDetection()
{
}
void MovementComponent::GetCollisionObjects(std::set<Entity*>& objects)
{

View File

@ -9,6 +9,7 @@ class MovementComponent
Vector2D target_point;
std::set<Entity*> detection_objects;
void RayDetection();
void GetCollisionObjects(std::set<Entity*>& objects);
bool TestCollision();
};

View File

@ -21,6 +21,7 @@
#include "roommgr.h"
#include "app.h"
#include "hero.h"
#include "movement.h"
const int ROOM_MAX_PLAYER_NUM = 50;
@ -605,7 +606,7 @@ void Room::CreateBullet(Human* hum, Weapon* weapon,
AddObjectLater(bullet);
grid_service.AddBullet(bullet);
#ifdef RAY_DETECTION
bullet->RayDetection();
bullet->movement->RayDetection();
#endif
}