This commit is contained in:
aozhiwei 2023-06-27 16:01:45 +08:00
parent 28b8b144ef
commit a7629bd696

View File

@ -3495,5 +3495,17 @@ void Room::LockRoom()
bool Room::BulletCanReach(const glm::vec3& start, const glm::vec3& end) bool Room::BulletCanReach(const glm::vec3& start, const glm::vec3& end)
{ {
glm::vec3 a_start = start;
glm::vec3 a_end = end;
glm::vec3 hit_point;
bool hit_result = false;
map_instance->Scale(a_start);
map_instance->Scale(a_end);
if (map_instance->Raycast(a_start, a_end, hit_point, hit_result)) {
if (!hit_result) {
return true;
}
}
return false;
} }