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:
10
geo/Point3.h
10
geo/Point3.h
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user