]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/geometry.h
Don't crash if a train has no router
[r2c2.git] / source / libr2c2 / geometry.h
index 09044e35886d6ccf1df13d5d0c5b5d77a0acca0d..dc29212735fa806b8c9fb79668c20bb5a735a19c 100644 (file)
@@ -5,6 +5,8 @@
 #include <vector>
 #include <msp/geometry/affinetransformation.h>
 #include <msp/geometry/angle.h>
+#include <msp/geometry/ray.h>
+#include <msp/geometry/shape.h>
 #include <msp/linal/vector.h>
 
 namespace R2C2 {
@@ -24,13 +26,15 @@ inline Vector rotated_vector(const Vector &v, const Angle &a)
 inline Vector vector_at_angle(const Angle &a)
 { return rotated_vector(Vector(1, 0, 0), a); }
 
-struct TrackPoint
-{
-       Vector pos;
-       Angle dir;
-       float grade;
+typedef Msp::Geometry::Shape<float, 3> Shape;
+typedef Msp::Geometry::Ray<float, 3> Ray;
+typedef Msp::Geometry::BoundingBox<float, 3> BoundingBox;
 
-       TrackPoint(): grade(0) { }
+struct OrientedPoint
+{
+       Vector position;
+       Angle rotation;
+       Angle tilt;
 };
 
 } // namespace R2C2