- unsigned index = 0;
- GL::MeshBuilder bld(ballast_mesh);
- bld.color(0.25f, 0.25f, 0.25f);
- for(vector<TrackPart>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
- build_part(*i, ballast_profile, Point(0, -ballast_min.y), bld, index);
+ object = catalogue.get<GL::Object>(obj_name);
+ const GL::Mesh *m = object->get_mesh();
+ const GL::VertexArray &vertices = m->get_vertices();
+ int vertex_offs = vertices.get_format().offset(GL::VERTEX2);
+ if(vertex_offs>=0)
+ {
+ for(unsigned i=0; i<vertices.size(); ++i)
+ {
+ const float *v = vertices[i]+vertex_offs;
+ border.push_back(Vector(v[0], v[1]));
+ }
+ }