This commit is contained in:
aozhiwei 2023-03-20 18:54:34 +08:00
parent a502061f8d
commit 44487e48ec

View File

@ -398,24 +398,26 @@ void Bullet::MapServiceUpdate()
auto old_pos = GetPos(); auto old_pos = GetPos();
GetMutablePos().AddGlmVec3(dir * step_len); GetMutablePos().AddGlmVec3(dir * step_len);
float distance = GetPos().DistanceGlmVec3(born_pos.ToGlmVec3()); float distance = GetPos().DistanceGlmVec3(born_pos.ToGlmVec3());
#ifdef DEBUG1 #ifdef DEBUG
if (IsFlyHook()) {
a8::XPrintf("step_len:%f born_pos:%f,%f,%f curr_pos:%f,%f,%f old_pos:%f,%f,%f distance:%f\n", a8::XPrintf("step_len:%f born_pos:%f,%f,%f curr_pos:%f,%f,%f old_pos:%f,%f,%f distance:%f\n",
{ {
step_len, step_len,
born_pos.x, born_pos.GetX(),
born_pos.y, born_pos.GetY(),
born_pos.z, born_pos.GetZ(),
old_pos.x, old_pos.GetX(),
old_pos.y, old_pos.GetY(),
old_pos.z, old_pos.GetZ(),
GetPos().x, GetPos().GetX(),
GetPos().y, GetPos().GetY(),
GetPos().z, GetPos().GetZ(),
distance distance
}); });
}
#endif #endif
if (room->OverBorder(GetPos().ToGlmVec3(), gun_meta->bullet_rad())) { if (room->OverBorder(GetPos().ToGlmVec3(), gun_meta->bullet_rad())) {
if (IsBomb()) { if (IsBomb()) {
@ -930,6 +932,11 @@ void Bullet::ProcNormalBullet(BulletCheckResult& result)
} }
if (need_remove) { if (need_remove) {
if (IsFlyHook()) { if (IsFlyHook()) {
#ifdef DEBUG
a8::XPrintf("ProcHookHit\n",
{
});
#endif
if (!hited) { if (!hited) {
if (raycast_hited) { if (raycast_hited) {
if (result.flyed_distance > 0.001f) { if (result.flyed_distance > 0.001f) {
@ -1015,13 +1022,14 @@ void Bullet::Raycast()
raycast_len_ = gun_meta->range(); raycast_len_ = gun_meta->range();
} }
#ifdef DEBUG #ifdef DEBUG
a8::XPrintf("bullet.raycast ret:%d hit_result:%d raycast_hit_point_:%f,%f,%f\n", a8::XPrintf("bullet.raycast ret:%d hit_result:%d raycast_hit_point_:%f,%f,%f speed:%f\n",
{ {
ret, ret,
hit_result, hit_result,
raycast_hit_point_.x, raycast_hit_point_.x,
raycast_hit_point_.y, raycast_hit_point_.y,
raycast_hit_point_.z, raycast_hit_point_.z,
gun_meta->bullet_speed()
}); });
#endif #endif
} }