]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/track.h
Fix linking issues with mspnet
[r2c2.git] / source / libr2c2 / track.h
index 8f75f78fc1c093f94e83f74e70a5518b1f378aa3..4dbfa2db87eabd56c12616f759adebdef1f4ca2c 100644 (file)
@@ -1,17 +1,10 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2006-2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #ifndef LIBR2C2_TRACK_H_
 #define LIBR2C2_TRACK_H_
 
 #include <list>
 #include <set>
 #include <sigc++/trackable.h>
-#include <msp/datafile/loader.h>
+#include <msp/datafile/objectloader.h>
 #include "geometry.h"
 
 namespace R2C2 {
@@ -23,7 +16,7 @@ class TrackType;
 class Track: public sigc::trackable
 {
 public:
-       class Loader: public Msp::DataFile::BasicLoader<Track>
+       class Loader: public Msp::DataFile::ObjectLoader<Track>
        {
        public:
                Loader(Track &);
@@ -48,6 +41,7 @@ private:
        unsigned sensor_id;
        std::vector<Track *> links;
        unsigned active_path;
+       bool path_changing;
 
        Track(const Track &);
        Track &operator=(const Track &);
@@ -76,6 +70,7 @@ public:
        unsigned get_sensor_id() const { return sensor_id; }
        void set_active_path(unsigned);
        unsigned get_active_path() const { return active_path; }
+       bool is_path_changing() const { return path_changing; }
 
        int get_endpoint_by_link(Track &) const;
        Vector get_endpoint_position(unsigned) const;
@@ -88,6 +83,9 @@ public:
        Track *get_link(unsigned) const;
        TrackPoint get_point(unsigned, unsigned, float) const;
        TrackPoint get_point(unsigned, float) const;
+       TrackPoint get_nearest_point(const Vector &) const;
+
+       bool collide_ray(const Vector &, const Vector &);
 
        void save(std::list<Msp::DataFile::Statement> &) const;
 private: