/* $Id$
-This file is part of the MSP Märklin suite
+This file is part of R²C²
Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
#include <cmath>
#include <msp/gl/matrix.h>
#include <msp/gl/misc.h>
-#include "libmarklin/tracktype.h"
+#include "libr2c2/tracktype.h"
#include "endpoint.h"
#include "layout.h"
#include "path.h"
using namespace std;
using namespace Msp;
-namespace Marklin {
+namespace R2C2 {
Track3D::Track3D(Layout3D &l, Track &t):
layout(l),
layout.add_track(*this);
layout.get_scene().add(*this);
- const vector<Endpoint> &type_eps = track.get_type().get_endpoints();
+ const vector<TrackType::Endpoint> &type_eps = track.get_type().get_endpoints();
for(unsigned i=0; i<type_eps.size(); ++i)
endpoints.push_back(new Endpoint3D(*this, i));
}
const Point &pos = track.get_position();
float rot = track.get_rotation();
- glTranslatef(pos.x, pos.y, pos.z);
- glRotatef(rot*180/M_PI, 0, 0, 1);
- glRotatef(track.get_slope()/track.get_type().get_total_length()*180/M_PI, 0, -1, 0);
+ GL::translate(pos.x, pos.y, pos.z);
+ GL::rotate(rot*180/M_PI, 0, 0, 1);
+ GL::rotate(track.get_slope()/track.get_type().get_total_length()*180/M_PI, 0, -1, 0);
}
void Track3D::render(const GL::Tag &tag) const
glPopName();
}
-} // namespace Marklin
+} // namespace R2C2