1
This commit is contained in:
parent
9228c805ae
commit
6dacb8c500
@ -2567,12 +2567,18 @@ void Creature::OnLand()
|
||||
room->map_instance->Scale(center);
|
||||
glm::vec3 point;
|
||||
bool ok = false;
|
||||
#if 1
|
||||
center = GetPos().ToGlmVec3();
|
||||
room->map_instance->Scale(center);
|
||||
ok = room->map_instance->FindOnLandPoint(center, point);
|
||||
#else
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
ok = room->map_instance->FindNearestPoint(center, 1.0f + 10 * i, point);
|
||||
if (ok) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if 1
|
||||
if (point.y < 1.2) {
|
||||
point.y = 3.0f;
|
||||
|
@ -1110,3 +1110,8 @@ bool MapInstance::GetNearestGrass(const glm::vec3& center, glm::vec3& out_pt)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MapInstance::FindOnLandPoint(const glm::vec3& center, glm::vec3& nearest_pt)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ class MapInstance : public std::enable_shared_from_this<MapInstance>
|
||||
int& same_polys_flags, std::vector<dtPolyRef>& spec_polys,
|
||||
unsigned short exclude_flags);
|
||||
bool FindNearestPoint(const glm::vec3& center, float radius, glm::vec3& nearestPt);
|
||||
bool FindOnLandPoint(const glm::vec3& center, glm::vec3& nearest_pt);
|
||||
bool GetPosHeight(const Position& pos, float& out_height);
|
||||
dtPoly* GetPoly(glm::vec3 pos, int& poly_idx);
|
||||
void Scale(glm::vec3& v);
|
||||
|
Loading…
x
Reference in New Issue
Block a user