started removing KLib related code:

- assertions
- distributions
new helper methods
worked on stairs
worked on grid-walkers
worked on navigation
This commit is contained in:
2016-01-27 20:03:58 +01:00
parent e6329e1db4
commit 0e05f4bef8
26 changed files with 408 additions and 109 deletions

View File

@@ -19,12 +19,12 @@ public:
/** ctor with radians */
Heading(const float rad) : rad(rad) {
_assertBetween(rad, 0, _2PI, "radians out of bounds");
Assert::isBetween(rad, 0.0f, (float)_2PI, "radians out of bounds");
}
/** ctor from(x1,y1) to(x2,y2) */
Heading(const float x1, const float y1, const float x2, const float y2) : rad(Angle::getRAD_2PI(x1,y1,x2,y2)) {
_assertBetween(rad, 0, _2PI, "radians out of bounds");
Assert::isBetween(rad, 0.0f, (float)_2PI, "radians out of bounds");
}
/** angular difference [0:PI] */
@@ -34,7 +34,7 @@ public:
/** update the angle but ensure we stay within [0:2PI] */
Heading& operator += (const float _rad) {
_assertBetween(_rad, -_2PI*0.99, +_2PI*0.99, "radians out of bounds");
Assert::isBetween(_rad, float(-_2PI*0.99), float(+_2PI*0.99), "radians out of bounds");
rad += _rad;
if (rad >= _2PI) {rad -= _2PI;}
else if (rad < 0) {rad += _2PI;}