new test cases
worked on all walkers new helper methods new distributions some bugfixes
This commit is contained in:
@@ -46,6 +46,10 @@ public:
|
||||
return (Heading(*this) += _rad);
|
||||
}
|
||||
|
||||
/** compare two headings */
|
||||
bool operator == (const Heading other) const {return rad == other.rad;}
|
||||
bool operator != (const Heading other) const {return rad != other.rad;}
|
||||
|
||||
/** get an inverted version of this heading (upwards -> downwards, left -> right, ...) */
|
||||
Heading getInverted() const {
|
||||
Heading out(rad);
|
||||
@@ -57,9 +61,10 @@ public:
|
||||
|
||||
/** get a random heading */
|
||||
static Heading rnd() {
|
||||
static std::minstd_rand gen; gen.seed(1234);
|
||||
static std::minstd_rand gen(1234);
|
||||
static std::uniform_real_distribution<float> dist(0, _2PI);
|
||||
return Heading(dist(gen));
|
||||
const float rnd = dist(gen);
|
||||
return Heading(rnd);
|
||||
}
|
||||
|
||||
#undef _2PI
|
||||
|
||||
Reference in New Issue
Block a user