X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Flayout.cpp;h=30994a378aa10cbc313861fcef0b0b96a4ce1d19;hb=9b07b35fd438f077896652258ac26453fc1c15dc;hp=be19b0020a9a2680b64e4750690cd288b0b8c1c6;hpb=346d933cb7d5d2e016ce235fb4336e202ca7708e;p=r2c2.git diff --git a/source/3d/layout.cpp b/source/3d/layout.cpp index be19b00..30994a3 100644 --- a/source/3d/layout.cpp +++ b/source/3d/layout.cpp @@ -1,6 +1,7 @@ #include "beamgate.h" #include "layout.h" #include "signal.h" +#include "terrain.h" #include "track.h" #include "utility.h" #include "vehicle.h" @@ -36,21 +37,6 @@ Layout3D::~Layout3D() delete objects.begin()->second; } -void Layout3D::get_bounds(Vector &minp, Vector &maxp) const -{ - Geometry::BoundingBox bbox; - - for(ObjectMap::const_iterator i=objects.begin(); i!=objects.end(); ++i) - { - const Shape *shape = i->second->get_object().get_shape(); - if(shape) - bbox = bbox|shape->get_axis_aligned_bounding_box(); - } - - minp = bbox.get_minimum_point(); - maxp = bbox.get_maximum_point(); -} - void Layout3D::add(Object3D &o) { insert_unique(objects, &o.get_object(), &o); @@ -86,6 +72,8 @@ void Layout3D::object_added(Object &o) new Vehicle3D(*this, *v); else if(BeamGate *g = dynamic_cast(&o)) new BeamGate3D(*this, *g); + else if(Terrain *r = dynamic_cast(&o)) + new Terrain3D(*this, *r); } void Layout3D::object_removed(Object &o)