From: Mikko Rasa Date: Wed, 2 Apr 2014 20:20:21 +0000 (+0300) Subject: Use elevation granularity for terrain Z positions X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9969895eea7f12d43333f81ad10234dd2208b4ef;p=r2c2.git Use elevation granularity for terrain Z positions --- diff --git a/source/libr2c2/terrain.cpp b/source/libr2c2/terrain.cpp index 8e0c60e..002a536 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 = int(position.z/eg+0.5)*eg; signal_moved.emit(); }