]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/object.h
Don't crash if a train has no router
[r2c2.git] / source / 3d / object.h
index a9ac7156f6e8af3cc864637b3c21590c5dafb708..aa6ce80aaf81641a05b1df13d420852240fbfeb1 100644 (file)
@@ -1,26 +1,34 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #ifndef R2C2_3D_OBJECT_H_
 #define R2C2_3D_OBJECT_H_
 
+#include <sigc++/trackable.h>
+#include <msp/gl/matrix.h>
 #include "libr2c2/geometry.h"
+#include "libr2c2/object.h"
 
 namespace R2C2 {
 
-class Object3D
+class Layout3D;
+
+class Object3D: public sigc::trackable
 {
 protected:
-       Object3D() { }
+       Layout3D &layout;
+       Object &object;
+       Msp::GL::Matrix matrix;
+
+       Object3D(Layout3D &, Object &);
 public:
-       virtual ~Object3D() { }
+       virtual ~Object3D();
+
+       Layout3D &get_layout() const { return layout; }
+       Object &get_object() const { return object; }
 
-       virtual Point get_node() const = 0;
+       const Msp::GL::Matrix &get_matrix() const { return matrix; }
+       virtual Vector get_node() const = 0;
        virtual bool is_visible() const = 0;
+protected:
+       virtual void moved();
 };
 
 } // namespace R2C2