]> git.tdb.fi Git - r2c2.git/blob - source/3d/train.cpp
Add a set_sensor function to the Driver interface
[r2c2.git] / source / 3d / train.cpp
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2010  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #include "layout.h"
9 #include "train.h"
10
11 namespace Marklin {
12
13 Train3D::Train3D(Layout3D &l, const Train &t):
14         layout(l),
15         train(t)
16 {
17         layout.add_train(*this);
18 }
19
20 Train3D::~Train3D()
21 {
22         layout.remove_train(*this);
23 }
24
25 Point Train3D::get_node() const
26 {
27         const Point &pos = train.get_position();
28         return Point(pos.x, pos.y, pos.z+0.02);
29 }
30
31 } // namespace Marklin