From: Mikko Rasa Date: Tue, 25 Jun 2013 16:12:38 +0000 (+0300) Subject: Give vehicle types a simple box geometry X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=350bed224de78737a073df9a2df7427b7036ac33;p=r2c2.git Give vehicle types a simple box geometry --- diff --git a/source/libr2c2/vehicletype.cpp b/source/libr2c2/vehicletype.cpp index 973070c..854308c 100644 --- a/source/libr2c2/vehicletype.cpp +++ b/source/libr2c2/vehicletype.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include #include "vehicletype.h" @@ -120,6 +122,13 @@ VehicleType::Loader::Loader(VehicleType &vt): add("width", &Loader::width); } +void VehicleType::Loader::finish() +{ + obj.shape = new Geometry::TransformedShape( + Geometry::Box(obj.length, obj.width, obj.height), + Transform::translation(Vector(0, 0, obj.height/2))); +} + void VehicleType::Loader::axle() { Axle axl; diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index 841664e..145a08d 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -18,6 +18,7 @@ public: public: Loader(VehicleType &); private: + virtual void finish(); void axle(); void bogie(); void function(unsigned, const std::string &);