This commit is contained in:
aozhiwei 2023-03-24 18:55:35 +08:00
parent 9616288511
commit 231837a663

View File

@ -1030,14 +1030,24 @@ 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 speed:%f\n", float distance = 0.0f;
if (hit_result) {
glm::vec3 v1 = raycast_hit_point_;
glm::vec3 v2 = born_pos.ToGlmVec3();
v1.y = 0.0f;
v2.y = 0.0f;
distance = GlmHelper::Norm(v1 - v2);
}
a8::XPrintf("bullet.raycast ret:%d hit_result:%d raycast_hit_point_:%f,%f,%f speed:%f range:%f distance:%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() gun_meta->bullet_speed(),
}); gun_meta->range(),
distance
});
#endif #endif
} }