]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/tracktype.cpp
Move track appearance properties into a separate class
[r2c2.git] / source / 3d / tracktype.cpp
index d73387c998dbbece809ef234767e77ff8a4b5802..d664c3948ef7a1c9bf54998a4abe661c45b2568e 100644 (file)
@@ -15,15 +15,16 @@ TrackType3D::TrackType3D(Catalogue3D &c, const TrackType &tt):
        object(0),
        own_data(false)
 {
+       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;
@@ -53,7 +54,7 @@ TrackType3D::TrackType3D(Catalogue3D &c, const TrackType &tt):
 
                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;
        }