added several grid-walks

added new helper methods/classes (e.g. for heading)
new test cases
optimize the dijkstra
cleanups/refactoring
added timed-benchmarks to the log
many more...
This commit is contained in:
2016-01-24 18:59:06 +01:00
parent cdf97322f8
commit 9947dced15
30 changed files with 1406 additions and 94 deletions

View File

@@ -1,6 +1,8 @@
#ifndef POINT3_H
#define POINT3_H
#include <KLib/Assertions.h>
/**
* 3D Point
*/
@@ -26,6 +28,14 @@ struct Point3 {
Point3& operator /= (const float v) {x/=v; y/=v; z/=v; return *this;}
/** read-only array access */
float operator [] (const int idx) const {
_assertBetween(idx, 0, 2, "index out of bounds");
if (0 == idx) {return x;}
if (1 == idx) {return y;}
return z;
}
float length() const {return std::sqrt(x*x + y*y + z*z);}
float length(const float norm) const {