1
This commit is contained in:
parent
b52ba4ee77
commit
7515adebae
@ -50,13 +50,6 @@ void Bullet::RecalcSelfCollider()
|
|||||||
self_collider_->rad = gun_meta->i->bullet_rad();
|
self_collider_->rad = gun_meta->i->bullet_rad();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RAY_DETECTION
|
|
||||||
void Bullet::RayDetection()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Bullet::OnHit(std::set<Entity*>& objects)
|
void Bullet::OnHit(std::set<Entity*>& objects)
|
||||||
{
|
{
|
||||||
for (auto& target : objects) {
|
for (auto& target : objects) {
|
||||||
|
@ -31,7 +31,6 @@ class Bullet : public Entity
|
|||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
virtual void Update(int delta_time) override;
|
virtual void Update(int delta_time) override;
|
||||||
void RecalcSelfCollider();
|
void RecalcSelfCollider();
|
||||||
void RayDetection();
|
|
||||||
void ClearRayData();
|
void ClearRayData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
|
|
||||||
|
void MovementComponent::RayDetection()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void MovementComponent::GetCollisionObjects(std::set<Entity*>& objects)
|
void MovementComponent::GetCollisionObjects(std::set<Entity*>& objects)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ class MovementComponent
|
|||||||
Vector2D target_point;
|
Vector2D target_point;
|
||||||
std::set<Entity*> detection_objects;
|
std::set<Entity*> detection_objects;
|
||||||
|
|
||||||
|
void RayDetection();
|
||||||
void GetCollisionObjects(std::set<Entity*>& objects);
|
void GetCollisionObjects(std::set<Entity*>& objects);
|
||||||
bool TestCollision();
|
bool TestCollision();
|
||||||
};
|
};
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "roommgr.h"
|
#include "roommgr.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "hero.h"
|
#include "hero.h"
|
||||||
|
#include "movement.h"
|
||||||
|
|
||||||
const int ROOM_MAX_PLAYER_NUM = 50;
|
const int ROOM_MAX_PLAYER_NUM = 50;
|
||||||
|
|
||||||
@ -605,7 +606,7 @@ void Room::CreateBullet(Human* hum, Weapon* weapon,
|
|||||||
AddObjectLater(bullet);
|
AddObjectLater(bullet);
|
||||||
grid_service.AddBullet(bullet);
|
grid_service.AddBullet(bullet);
|
||||||
#ifdef RAY_DETECTION
|
#ifdef RAY_DETECTION
|
||||||
bullet->RayDetection();
|
bullet->movement->RayDetection();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user