diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2016-12-14 15:17:01 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-12-21 15:46:36 -0800 |
commit | 38b5cb0c7766152f7e49cce8bd6c5d3e04dd0663 (patch) | |
tree | 9f64568fbe56a17a0c1fcd5396bf6c9e80992843 /src/mbgl/programs | |
parent | ebd241363d5c926d471559208f391190666febb9 (diff) | |
download | qtlocation-mapboxgl-38b5cb0c7766152f7e49cce8bd6c5d3e04dd0663.tar.gz |
[core, ios] replace `altitude` with `fov`
ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19
`altitude` was a terribly-named variable that was used to indirectly
control the fov. This should eliminate some confusion.
`altitude` was equivalent to `cameraToCenterDistance / height`
Diffstat (limited to 'src/mbgl/programs')
-rw-r--r-- | src/mbgl/programs/line_program.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/programs/symbol_program.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/programs/line_program.cpp b/src/mbgl/programs/line_program.cpp index 2cadaa6c11..cd53337c10 100644 --- a/src/mbgl/programs/line_program.cpp +++ b/src/mbgl/programs/line_program.cpp @@ -25,7 +25,7 @@ Values makeValues(const LinePaintProperties::Evaluated& properties, // calculate how much longer the real world distance is at the top of the screen // than at the middle of the screen. - float topedgelength = std::sqrt(std::pow(state.getSize().height, 2.0f) / 4.0f * (1.0f + std::pow(state.getAltitude(), 2.0f))); + float topedgelength = std::sqrt(std::pow(state.getSize().height, 2.0f) / 4.0f * (1.0f + std::pow(state.getCameraToCenterDistance(), 2.0f))); float x = state.getSize().height / 2.0f * std::tan(state.getPitch()); return Values { diff --git a/src/mbgl/programs/symbol_program.cpp b/src/mbgl/programs/symbol_program.cpp index 71b45ad4fc..d609dada8d 100644 --- a/src/mbgl/programs/symbol_program.cpp +++ b/src/mbgl/programs/symbol_program.cpp @@ -23,8 +23,8 @@ Values makeValues(const style::SymbolPropertyValues& values, extrudeScale.fill(tile.id.pixelsToTileUnits(1, state.getZoom()) * scale); } else { extrudeScale = {{ - pixelsToGLUnits[0] * scale * state.getAltitude(), - pixelsToGLUnits[1] * scale * state.getAltitude() + pixelsToGLUnits[0] * scale * state.getCameraToCenterDistance(), + pixelsToGLUnits[1] * scale * state.getCameraToCenterDistance() }}; } @@ -77,7 +77,7 @@ static SymbolSDFProgram::UniformValues makeSDFValues(const style::SymbolProperty const float gammaBase = 0.105 * values.sdfScale / values.paintSize / pixelRatio; const float gammaScale = (values.pitchAlignment == AlignmentType::Map ? 1.0 / std::cos(state.getPitch()) - : 1.0) / state.getAltitude(); + : 1.0) / state.getCameraToCenterDistance(); return makeValues<SymbolSDFProgram::UniformValues>( values, |