mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix altitude clamping for points without Z values
This commit is contained in:
parent
b5fec5872b
commit
78da017f74
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user