-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
#include <cmath>
#include <msp/gl/matrix.h>
#include <msp/gl/renderer.h>
vehicle(v),
type(layout.get_catalogue().get_vehicle(vehicle.get_type()))
{
- unsigned n_axles = vehicle.get_type().get_axles().size();
+ unsigned n_axles = vehicle.get_type().get_fixed_axles().size();
for(unsigned i=0; i<n_axles; ++i)
- if(type.get_axle_object(i))
+ if(type.get_fixed_axle_object(i))
{
Axle3D *a = new Axle3D(*this, i);
axles.push_back(a);
delete *i;
}
-Point Vehicle3D::get_node() const
+Vector Vehicle3D::get_node() const
{
- Point p = vehicle.get_position();
- return Point(p.x, p.y, p.z+0.01+vehicle.get_type().get_height());
+ Vector p = vehicle.get_position();
+ return Vector(p.x, p.y, p.z+0.01+vehicle.get_type().get_height());
}
bool Vehicle3D::is_visible() const
void Vehicle3D::setup_render(GL::Renderer &renderer, const GL::Tag &) const
{
GL::Matrix matrix;
- const Point &pos = vehicle.get_position();
+ const Vector &pos = vehicle.get_position();
matrix.translate(pos.x, pos.y, pos.z);
matrix.rotate(vehicle.get_direction(), 0, 0, 1);
renderer.matrix_stack() *= matrix;