2 #include <msp/gl/matrix.h>
3 #include <msp/gl/misc.h>
4 #include <msp/gl/renderer.h>
13 Endpoint3D::Endpoint3D(const Track3D &t, unsigned i):
16 mesh(track.get_layout().get_catalogue().get_endpoint_mesh())
18 track.get_layout().get_endpoint_scene().add(*this);
21 Endpoint3D::~Endpoint3D()
23 track.get_layout().get_endpoint_scene().remove(*this);
26 void Endpoint3D::render(GL::Renderer &renderer, const GL::Tag &tag) const
30 Snap sn = track.get_track().get_snap_node(index);
32 GL::MatrixStack::Push push_mtx(renderer.matrix_stack());
34 matrix.translate(sn.position.x, sn.position.y, sn.position.z);
35 matrix.rotate(sn.rotation+M_PI, 0, 0, 1);
36 renderer.matrix_stack() *= matrix;
38 if(track.get_track().get_link(index))
39 glColor4f(0.5, 0, 1, 0.5);
41 glColor4f(1, 0, 0.5, 0.5);