added new helper methods

worked on gridWalker v3
This commit is contained in:
2017-10-17 13:01:26 +02:00
parent 556bbe8829
commit 3807c621c7
8 changed files with 299 additions and 42 deletions

View File

@@ -77,10 +77,10 @@ public:
}
Heading& operator = (const float _rad) {
rad = _rad;
return *this;
}
Heading& operator = (const float _rad) {
rad = _rad;
return *this;
}
/** compare two headings */
bool operator == (const Heading other) const {return rad == other.rad;}
@@ -95,6 +95,11 @@ public:
float getRAD() const {return rad;}
/** convert heading into a direction-vector */
Point2 asVector() const {
return Point2(std::cos(rad), std::sin(rad));
}
// /** get a random heading */
// static Heading rnd() {
// static std::minstd_rand gen(1234);