namespace R2C2 {
-TrackType3D::TrackType3D(Catalogue3D &cat3d, const TrackType &tt):
- catalogue(cat3d),
+TrackType3D::TrackType3D(Catalogue3D &c, const TrackType &tt):
+ ObjectType3D(c),
mesh(0),
object(0),
own_data(false)
{
- const Catalogue &cat = cat3d.get_catalogue();
+ const TrackAppearance &appearance = tt.get_appearance();
+ const Catalogue &cat = catalogue.get_catalogue();
const vector<TrackPart> &parts = tt.get_parts();
- const Profile &ballast_profile = cat.get_ballast_profile();
+ const Profile &ballast_profile = appearance.get_ballast_profile();
const Vector &ballast_min = ballast_profile.get_min_coords();
const Vector &ballast_max = ballast_profile.get_max_coords();
float ballast_h = ballast_max.y-ballast_min.y;
- const Profile &rail_profile = cat.get_rail_profile();
+ const Profile &rail_profile = appearance.get_rail_profile();
const Vector &rail_min = rail_profile.get_min_coords();
const Vector &rail_max = rail_profile.get_max_coords();
float rail_h = rail_max.y-rail_min.y;
object = new GL::Object;
object->set_mesh(mesh);
- object->set_technique(&catalogue.get<GL::Technique>(cat.get_track_technique()));
+ object->set_technique(&catalogue.get<GL::Technique>(appearance.get_technique()));
own_data = true;
}
unsigned n_vertices = profile.get_n_vertices();
for(unsigned i=0; i<=nsegs; ++i)
{
- TrackPoint basep = part.get_point(i*plen/nsegs);
- Transform trans = Transform::rotation(basep.dir, Vector(0, 0, 1));
+ OrientedPoint basep = part.get_point(i*plen/nsegs);
+ Transform trans = Transform::rotation(basep.rotation, Vector(0, 0, 1));
for(unsigned j=0; j<n_vertices; ++j)
{
Vector p(0, -v.pos.x, v.pos.y);
if(mirror)
p.y = -p.y;
- p = basep.pos+trans.transform(offset+p);
+ p = basep.position+trans.transform(offset+p);
Vector n(0, -v.normal.x, v.normal.y);
if(mirror)