1 #include <msp/gl/renderer.h>
5 #include "signaltype.h"
11 Signal3D::Signal3D(Layout3D &l, Signal &s):
12 GL::ObjectInstance(l.get_catalogue().get_signal(s.get_type()).get_object()),
16 layout.add_signal(*this);
17 layout.get_scene().add(*this);
22 layout.remove_signal(*this);
23 layout.get_scene().remove(*this);
26 void Signal3D::setup_render(GL::Renderer &renderer, const GL::Tag &) const
28 const Vector &pos = signal.get_position();
29 renderer.matrix_stack() *= GL::Matrix::translation(pos.x, pos.y, pos.z);
30 renderer.matrix_stack() *= GL::Matrix::rotation(signal.get_direction(), 0, 0, 1);
31 // XXX Use track gauge, configure signal side
32 renderer.matrix_stack() *= GL::Matrix::translation(0, -0.035, 0);