diff --git a/Core/src/LuaModule/utils.pkg b/Core/src/LuaModule/utils.pkg index 5c8725a6..4e879bb3 100644 --- a/Core/src/LuaModule/utils.pkg +++ b/Core/src/LuaModule/utils.pkg @@ -27,4 +27,5 @@ namespace Utils{ bool InTheirPenaltyArea(const CGeoPoint& p,const double buffer); bool PlayerNumValid(int num); bool canGo(const CVisionModule* pVision, const int num, const CGeoPoint& target, const int flag, const double avoidBuffer); + double angDiff(double angle1, double angle2); } \ No newline at end of file diff --git a/Core/src/Utils/utils.cpp b/Core/src/Utils/utils.cpp index 2755d786..7bb7c816 100644 --- a/Core/src/Utils/utils.cpp +++ b/Core/src/Utils/utils.cpp @@ -3,8 +3,11 @@ #include "staticparams.h" #include #include - +#include "geomcalc.h" namespace Utils{ + double angDiff(double angle1, double angle2){ + return angleDiff(angle1,angle2); + } double dirDiff(const CVector& v1, const CVector& v2) { return fabs(Normalize(v1.dir() - v2.dir()));} double Normalize(double angle) { diff --git a/Core/src/Utils/utils.h b/Core/src/Utils/utils.h index 96caccb4..31db2996 100644 --- a/Core/src/Utils/utils.h +++ b/Core/src/Utils/utils.h @@ -29,6 +29,8 @@ class CVisionModule; struct PlayerPoseT; namespace Utils { +extern double angDiff(double angle1, double angle2); + extern double Normalize(double angle);///<把角度规范化到(-PI,PI] extern CVector Polar2Vector(double m, double angle); ///<极坐标转换到直角坐标 extern double VectorDot(const CVector& v1, const CVector& v2); // 向量点乘