This commit is contained in:
aozhiwei 2023-03-09 15:01:31 +08:00
parent c44e9bb468
commit 847ad9b1dc

View File

@ -2913,7 +2913,28 @@ void Creature::ShortFindPath()
std::abs(GetMoveDir().z) > FLT_EPSILON
) {
#if 1
auto try_move =
[this] (glm::vec3 start, glm::vec3 end,
bool& block, glm::vec3& new_point, float& distance)
{
room->map_instance->Scale(start);
room->map_instance->Scale(end);
glm::vec3 hit_point;
bool hit_result = false;
bool ret = room->map_instance->Raycast(start, end, hit_point, hit_result);
if (ret) {
} else {
block = true;
}
};
glm::vec3 start_pos = GetPos().ToGlmVec3() + GetMoveDir() * -1.0f * 2.0f;
for (float angle = 30.0f; angle < 90.0f; angle += 30.0f) {
glm::vec3 move_dir = GetMoveDir();
GlmHelper::RotateY(move_dir, angle);
glm::vec3 end_pos = start_pos + move_dir * 80.0f;
}
#else
auto try_move =
[this] (glm::vec3& new_move_dir, bool& block, glm::vec3& new_point, float& distance)