Merge branch 'master' of https://git.frank-ebner.de/FHWS/Indoor
This commit is contained in:
@@ -46,6 +46,11 @@ public:
|
||||
return (Heading(*this) += _rad);
|
||||
}
|
||||
|
||||
Heading& operator = (const float _rad) {
|
||||
rad = _rad;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** compare two headings */
|
||||
bool operator == (const Heading other) const {return rad == other.rad;}
|
||||
bool operator != (const Heading other) const {return rad != other.rad;}
|
||||
@@ -59,13 +64,13 @@ public:
|
||||
|
||||
float getRAD() const {return rad;}
|
||||
|
||||
/** get a random heading */
|
||||
static Heading rnd() {
|
||||
static std::minstd_rand gen(1234);
|
||||
static std::uniform_real_distribution<float> dist(0, _2PI);
|
||||
const float rnd = dist(gen);
|
||||
return Heading(rnd);
|
||||
}
|
||||
// /** get a random heading */
|
||||
// static Heading rnd() {
|
||||
// static std::minstd_rand gen(1234);
|
||||
// static std::uniform_real_distribution<float> dist(0, _2PI);
|
||||
// const float rnd = dist(gen);
|
||||
// return Heading(rnd);
|
||||
// }
|
||||
|
||||
#undef _2PI
|
||||
|
||||
|
||||
Reference in New Issue
Block a user