TrinityCore
ChaseAngle Struct Reference

#include <MovementDefines.h>

Public Member Functions

 ChaseAngle (float angle, float _tolerance=M_PI_4)
 
float UpperBound () const
 
float LowerBound () const
 
bool IsAngleOkay (float relativeAngle) const
 

Public Attributes

float RelativeAngle
 
float Tolerance
 

Detailed Description

Definition at line 104 of file MovementDefines.h.

Constructor & Destructor Documentation

◆ ChaseAngle()

ChaseAngle::ChaseAngle ( float  angle,
float  _tolerance = M_PI_4 
)

Definition at line 31 of file MovementDefines.cpp.

float RelativeAngle
static float NormalizeOrientation(float o)
Definition: Position.cpp:135

Member Function Documentation

◆ IsAngleOkay()

bool ChaseAngle::IsAngleOkay ( float  relativeAngle) const

Definition at line 43 of file MovementDefines.cpp.

44{
45 float const diff = std::abs(relativeAngle - RelativeAngle);
46
47 return (std::min(diff, float(2 * M_PI) - diff) <= Tolerance);
48}
#define M_PI
Definition: Common.h:115
+ Here is the caller graph for this function:

◆ LowerBound()

float ChaseAngle::LowerBound ( ) const

Definition at line 38 of file MovementDefines.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpperBound()

float ChaseAngle::UpperBound ( ) const

Definition at line 33 of file MovementDefines.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ RelativeAngle

float ChaseAngle::RelativeAngle

Definition at line 108 of file MovementDefines.h.

◆ Tolerance

float ChaseAngle::Tolerance

Definition at line 109 of file MovementDefines.h.


The documentation for this struct was generated from the following files: