]> git.tdb.fi Git - r2c2.git/blob - source/3d/object.cpp
Sprinkle some comments on the routing system
[r2c2.git] / source / 3d / object.cpp
1 #include "layout.h"
2 #include "object.h"
3
4 using namespace Msp;
5
6 namespace R2C2 {
7
8 Object3D::Object3D(Layout3D &l, Object &o):
9         layout(l),
10         object(o)
11 {
12         object.signal_moved.connect(sigc::mem_fun(this, &Object3D::moved));
13         moved();
14
15         layout.add(*this);
16 }
17
18 Object3D::~Object3D()
19 {
20         layout.remove(*this);
21 }
22
23 void Object3D::moved()
24 {
25         matrix = GL::Matrix::translation(object.get_position());
26         matrix.rotate(object.get_rotation(), 0, 0, 1);
27         matrix.rotate(object.get_tilt(), 0, -1, 0);
28 }
29
30 } // namespace R2C2