1
This commit is contained in:
parent
dec6cf2cb3
commit
4b4daa509c
@ -3551,7 +3551,23 @@ bool Room::RandomSafeAreaPoint(glm::vec3& point)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Room::FindWalkablePointWithOutHouse(const glm::vec3& center, int try_count, int step, glm::vec3& point)
|
||||
bool Room::FindWalkablePointWithOutHouse(const glm::vec3& center, int try_count, int step, glm::vec3& out_point)
|
||||
{
|
||||
glm::vec3 ref_point = center;
|
||||
map_instance->PtInHouse(center, ref_point);
|
||||
map_instance->Scale(ref_point);
|
||||
glm::vec3 point;
|
||||
bool ok = false;
|
||||
for (int i = 0; i < try_count; ++i) {
|
||||
ok = map_instance->FindNearestPoint(ref_point, 1.0f + step * i, point);
|
||||
if (ok) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ok) {
|
||||
return false;
|
||||
}
|
||||
map_instance->UnScale(point);
|
||||
out_point = point;
|
||||
return true;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ public:
|
||||
int GetPolyExtFlag(int poly_idx);
|
||||
size_t GetRoomMaxPlayerNum();
|
||||
bool RandomSafeAreaPoint(glm::vec3& point);
|
||||
bool FindWalkablePointWithOutHouse(const glm::vec3& center, int try_count, int step, glm::vec3& point);
|
||||
bool FindWalkablePointWithOutHouse(const glm::vec3& center, int try_count, int step, glm::vec3& out_point);
|
||||
|
||||
private:
|
||||
void ShuaAndroid();
|
||||
|
Loading…
x
Reference in New Issue
Block a user