mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-05 20:13:48 +00:00
refactor(Core): apply clang-tidy modernize-* (#9975)
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -98,9 +98,9 @@ struct ChaseAngle
|
||||
float RelativeAngle; // we want to be at this angle relative to the target (0 = front, M_PI = back)
|
||||
float Tolerance; // but we'll tolerate anything within +- this much
|
||||
|
||||
float UpperBound() const;
|
||||
float LowerBound() const;
|
||||
bool IsAngleOkay(float relativeAngle) const;
|
||||
[[nodiscard]] float UpperBound() const;
|
||||
[[nodiscard]] float LowerBound() const;
|
||||
[[nodiscard]] bool IsAngleOkay(float relativeAngle) const;
|
||||
};
|
||||
|
||||
// assume it is 25 yard per 0.6 second
|
||||
|
||||
@@ -84,18 +84,18 @@ class PathGenerator
|
||||
void SetUseRaycast(bool useRaycast) { _useRaycast = useRaycast; }
|
||||
|
||||
// result getters
|
||||
G3D::Vector3 const& GetStartPosition() const { return _startPosition; }
|
||||
G3D::Vector3 const& GetEndPosition() const { return _endPosition; }
|
||||
G3D::Vector3 const& GetActualEndPosition() const { return _actualEndPosition; }
|
||||
[[nodiscard]] G3D::Vector3 const& GetStartPosition() const { return _startPosition; }
|
||||
[[nodiscard]] G3D::Vector3 const& GetEndPosition() const { return _endPosition; }
|
||||
[[nodiscard]] G3D::Vector3 const& GetActualEndPosition() const { return _actualEndPosition; }
|
||||
|
||||
Movement::PointsArray const& GetPath() const { return _pathPoints; }
|
||||
[[nodiscard]] Movement::PointsArray const& GetPath() const { return _pathPoints; }
|
||||
|
||||
PathType GetPathType() const { return _type; }
|
||||
[[nodiscard]] PathType GetPathType() const { return _type; }
|
||||
|
||||
// shortens the path until the destination is the specified distance from the target point
|
||||
void ShortenPathUntilDist(G3D::Vector3 const& point, float dist);
|
||||
|
||||
float getPathLength() const
|
||||
[[nodiscard]] float getPathLength() const
|
||||
{
|
||||
float len = 0.0f;
|
||||
float dx, dy, dz;
|
||||
@@ -156,19 +156,19 @@ class PathGenerator
|
||||
void SetActualEndPosition(G3D::Vector3 const& point) { _actualEndPosition = point; }
|
||||
void NormalizePath();
|
||||
|
||||
bool InRange(G3D::Vector3 const& p1, G3D::Vector3 const& p2, float r, float h) const;
|
||||
float Dist3DSqr(G3D::Vector3 const& p1, G3D::Vector3 const& p2) const;
|
||||
[[nodiscard]] bool InRange(G3D::Vector3 const& p1, G3D::Vector3 const& p2, float r, float h) const;
|
||||
[[nodiscard]] float Dist3DSqr(G3D::Vector3 const& p1, G3D::Vector3 const& p2) const;
|
||||
bool InRangeYZX(float const* v1, float const* v2, float r, float h) const;
|
||||
|
||||
dtPolyRef GetPathPolyByPosition(dtPolyRef const* polyPath, uint32 polyPathSize, float const* Point, float* Distance = nullptr) const;
|
||||
dtPolyRef GetPolyByLocation(float const* Point, float* Distance) const;
|
||||
bool HaveTile(G3D::Vector3 const& p) const;
|
||||
[[nodiscard]] bool HaveTile(G3D::Vector3 const& p) const;
|
||||
|
||||
void BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 const& endPos);
|
||||
void BuildPointPath(float const* startPoint, float const* endPoint);
|
||||
void BuildShortcut();
|
||||
|
||||
NavTerrain GetNavTerrain(float x, float y, float z) const;
|
||||
[[nodiscard]] NavTerrain GetNavTerrain(float x, float y, float z) const;
|
||||
void CreateFilter();
|
||||
void UpdateFilter();
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ namespace Movement
|
||||
{
|
||||
struct Location : public Vector3
|
||||
{
|
||||
Location() {}
|
||||
Location() = default;
|
||||
Location(float x, float y, float z, float o) : Vector3(x, y, z), orientation(o) {}
|
||||
Location(const Vector3& v) : Vector3(v), orientation(0) {}
|
||||
Location(const Vector3& v) : Vector3(v) {}
|
||||
Location(const Vector3& v, float o) : Vector3(v), orientation(o) {}
|
||||
|
||||
float orientation{0};
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Movement
|
||||
void UninitializedSplineInitMethod(Vector3 const*, index_type, bool, index_type) { ABORT(); }
|
||||
|
||||
public:
|
||||
explicit SplineBase() {}
|
||||
explicit SplineBase() = default;
|
||||
|
||||
/** Caclulates the position for given segment Idx, and percent of segment length t
|
||||
@param t - percent of segment length, assumes that t in range [0, 1]
|
||||
|
||||
Reference in New Issue
Block a user