diff --git a/server/gameserver/glmhelper.cc b/server/gameserver/glmhelper.cc index 4287746c..30bcffe9 100644 --- a/server/gameserver/glmhelper.cc +++ b/server/gameserver/glmhelper.cc @@ -85,6 +85,11 @@ bool GlmHelper::IsEqual2D(const glm::vec3& v1, const glm::vec3& v2) return std::abs(v1.x - v2.x) < 0.00001f && std::abs(v1.z - v2.z) < 0.00001f; } +bool GlmHelper::IsEqual2D(const glm::vec3& v1, float x, float z) +{ + return std::abs(v1.x - x) < 0.00001f && std::abs(v1.z - z) < 0.00001f; +} + bool GlmHelper::IsEqual3D(const glm::vec3& v1, const glm::vec3& v2) { return std::abs(v1.x - v2.x) < 0.00001f && diff --git a/server/gameserver/glmhelper.h b/server/gameserver/glmhelper.h index 3a914695..c1e5f2ef 100644 --- a/server/gameserver/glmhelper.h +++ b/server/gameserver/glmhelper.h @@ -17,6 +17,7 @@ class GlmHelper static bool IsValidVec3(const glm::vec3& v); static bool IsEqual2D(const glm::vec3& v1, const glm::vec3& v2); + static bool IsEqual2D(const glm::vec3& v1, float x, float z); static bool IsEqual3D(const glm::vec3& v1, const glm::vec3& v2); static float CalcAngle(const glm::vec3& v1, const glm::vec3& v2);