This commit is contained in:
aozhiwei 2023-02-09 16:27:21 +08:00
parent 8d59de6e31
commit 8e7b10c959

View File

@ -21,6 +21,7 @@
#include "buff.h"
#include "collision.h"
#include "mapinstance.h"
#include "debugcmd.h"
#include "mt/Param.h"
#include "mt/Equip.h"
@ -60,6 +61,22 @@ void Bullet::Initialize()
}
Raycast();
}
#ifdef DEBUG
if (DebugCmd::Enable() && sender.Get() && sender.Get()) {
glm::vec3 hit_pos;
bool hited = room->map_instance->SceneRaycast
(GetPos().ToGlmVec3(),
dir,
gun_meta->range(),
hit_pos);
if (hited) {
DebugCmd::CreateSphere(sender.Get(),
hit_pos,
glm::vec3(10, 10, 10),
room->AllocUniid());
}
}
#endif
}
void Bullet::Update(int delta_time)