Skip to content
Permalink
Browse files

Fix altitude clamping for points without Z values

  • Loading branch information
wonder-sk committed Apr 5, 2019
1 parent b5fec58 commit 78da017f74c58dad27286da1d1df8e3fa8c522ce
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/3d/qgs3dutils.cpp
@@ -256,7 +256,9 @@ float Qgs3DUtils::clampAltitude( const QgsPoint &p, Qgs3DTypes::AltitudeClamping
terrainZ = map.terrainGenerator()->heightAt( pt.x(), pt.y(), map );
}

float geomZ = altClamp == Qgs3DTypes::AltClampAbsolute || altClamp == Qgs3DTypes::AltClampRelative ? p.z() : 0;
float geomZ = 0;
if ( p.is3D() && ( altClamp == Qgs3DTypes::AltClampAbsolute || altClamp == Qgs3DTypes::AltClampRelative ) )
geomZ = p.z();

float z = ( terrainZ + geomZ ) * map.terrainVerticalScale() + height;
return z;

0 comments on commit 78da017

Please sign in to comment.
You can’t perform that action at this time.