X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fterrain.cpp;h=ccfd912a2fd65e5e1048aa5c14b759fe7382bc3c;hb=9b8a32cf7371bc5fae8ce239a212469511c459e6;hp=c89d0f8cf20621df2e5befa06f4d57b404c7c1c3;hpb=d6816c177ee8d5f5191e833dce8e3c4e7e0222bf;p=r2c2.git diff --git a/source/libr2c2/terrain.cpp b/source/libr2c2/terrain.cpp index c89d0f8..ccfd912 100644 --- a/source/libr2c2/terrain.cpp +++ b/source/libr2c2/terrain.cpp @@ -38,6 +38,8 @@ Terrain *Terrain::clone(Layout *to_layout) const void Terrain::set_position(const Vector &p) { position = p; + float eg = type.get_elevation_granularity(); + position.z = round(position.z/eg)*eg; signal_moved.emit(); } @@ -63,7 +65,7 @@ void Terrain::set_size(unsigned w, unsigned h) delete shape; float ts = type.get_tile_size(); - Vector dim(width*ts, height*ts, ts); + Vector dim(width*ts, height*ts, ts/10.0f); shape = new Geometry::TransformedShape( Geometry::Box(dim), Transform::translation(dim/2.0f));