AzeorthCore 3.3.5a OpenSource WoW Emulator
Searching...
No Matches
CircleBoundary Class Reference

#include "AreaBoundary.h"

Inheritance diagram for CircleBoundary:

## Public Member Functions

CircleBoundary (Position const &center, double radius, bool isInverted=false)

CircleBoundary (Position const &center, Position const &pointOnCircle, bool isInverted=false)

Public Member Functions inherited from AreaBoundary
bool IsWithinBoundary (Position const *pos) const

bool IsWithinBoundary (Position const &pos) const

virtual ~AreaBoundary ()

## Protected Member Functions

bool IsWithinBoundaryArea (Position const *pos) const override

Protected Member Functions inherited from AreaBoundary
AreaBoundary (bool isInverted)

virtual bool IsWithinBoundaryArea (Position const *pos) const =0

## Private Attributes

DoublePosition const _center

## ◆ CircleBoundary() [1/2]

 CircleBoundary::CircleBoundary ( Position const & center, double radius, bool isInverted = false )
36 :
Definition: AreaBoundary.h:24
DoublePosition const _center
Definition: AreaBoundary.h:98
Definition: AreaBoundary.h:99

## ◆ CircleBoundary() [2/2]

 CircleBoundary::CircleBoundary ( Position const & center, Position const & pointOnCircle, bool isInverted = false )
39 :
40 AreaBoundary(isInverted), _center(center), _radiusSq(_center.GetDoubleExactDist2dSq(pointOnCircle)) { }
double GetDoubleExactDist2dSq(DoublePosition const &pos) const
Definition: AreaBoundary.h:49

## ◆ IsWithinBoundaryArea()

 bool CircleBoundary::IsWithinBoundaryArea ( Position const * pos ) const
overrideprotectedvirtual

Implements AreaBoundary.

43{
44 double offX = _center.GetDoublePositionX() - pos->GetPositionX();
45 double offY = _center.GetDoublePositionY() - pos->GetPositionY();
46 return offX * offX + offY * offY <= _radiusSq;
47}
double GetDoublePositionY() const
Definition: AreaBoundary.h:46
double GetDoublePositionX() const
Definition: AreaBoundary.h:45

## ◆ _center

 DoublePosition const CircleBoundary::_center
private

Referenced by IsWithinBoundaryArea().