]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/track.cpp
Add utility functions to make endpoint path mask operations clearer
[r2c2.git] / source / 3d / track.cpp
index 8b36b194220c0c3175da4c322e9b846e5112b656..72973f3a9b4bc03501af1777d004a275f14cc5b6 100644 (file)
@@ -1,13 +1,5 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <cmath>
 #include <msp/gl/matrix.h>
-#include <msp/gl/misc.h>
 #include <msp/gl/renderer.h>
 #include "libr2c2/tracktype.h"
 #include "endpoint.h"
@@ -91,7 +83,7 @@ Vector Track3D::get_node() const
        return Vector(pos.x+c*center.x-s*center.y, pos.y+s*center.x+c*center.y, pos.z+0.02);
 }
 
-GL::Matrix Track3D::get_matrix() const
+GL::Matrix Track3D::create_matrix() const
 {
        const Vector &pos = track.get_position();
        float rot = track.get_rotation();
@@ -106,13 +98,7 @@ GL::Matrix Track3D::get_matrix() const
 
 void Track3D::setup_render(Msp::GL::Renderer &renderer, const GL::Tag &) const
 {
-       renderer.matrix_stack() *= get_matrix();
-       glPushName(reinterpret_cast<unsigned>(this));
-}
-
-void Track3D::finish_render(Msp::GL::Renderer &, const GL::Tag &) const
-{
-       glPopName();
+       renderer.matrix_stack() *= create_matrix();
 }
 
 void Track3D::link_changed(unsigned i, Track *trk)