X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fendpoint.cpp;h=e851007b2ba0736546f27b6d81ae5bac2518a1c5;hb=e621dd4120cb253417167b4295e436cee095ccb0;hp=7e33ced696d92cc2abb3da7b54ddfbcaa0606ed6;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/3d/endpoint.cpp b/source/3d/endpoint.cpp index 7e33ced..e851007 100644 --- a/source/3d/endpoint.cpp +++ b/source/3d/endpoint.cpp @@ -1,13 +1,7 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include #include #include +#include #include "endpoint.h" #include "layout.h" #include "track.h" @@ -29,24 +23,25 @@ Endpoint3D::~Endpoint3D() track.get_layout().get_endpoint_scene().remove(*this); } -void Endpoint3D::render(const GL::Tag &tag) const +void Endpoint3D::render(GL::Renderer &renderer, const GL::Tag &tag) const { if(tag=="unlit") { - Point p = track.get_track().get_endpoint_position(index); + Vector p = track.get_track().get_endpoint_position(index); float a = track.get_track().get_endpoint_direction(index)+M_PI; - GL::PushMatrix push_mat; - GL::translate(p.x, p.y, p.z); - GL::rotate(a*180/M_PI, 0, 0, 1); + GL::MatrixStack::Push push_mtx(renderer.matrix_stack()); + GL::Matrix matrix; + matrix.translate(p.x, p.y, p.z); + matrix.rotate(a, 0, 0, 1); + renderer.matrix_stack() *= matrix; - GL::set(GL_CULL_FACE, track.get_track().get_link(index)); if(track.get_track().get_link(index)) glColor4f(0.5, 0, 1, 0.5); else glColor4f(1, 0, 0.5, 0.5); - mesh.draw(); + mesh.draw(renderer); } }