Skip to content
Permalink
Browse files

fix #6307 / close #476

  • Loading branch information...
rtri
rtri committed Oct 3, 2019
1 parent acae855 commit da1b511b153e6093190dba9dd8adaa491f65d785
Showing with 4 additions and 2 deletions.
  1. +3 −1 rts/Game/Camera.cpp
  2. +1 −1 rts/Rendering/GlobalRendering.cpp
@@ -268,7 +268,9 @@ void CCamera::UpdateViewRange()
// camera-height dependence (i.e. TAB-view)
wantedViewRange = std::max(wantedViewRange, (pos.y - std::max(0.0f, mapMinHeight)) * 2.0f);
// view-angle dependence (i.e. FPS-view)
wantedViewRange = std::max(wantedViewRange, (1.0f - std::max(0.0f, forward.dot(UpVector))) * maxEdgeDist);
// forward normally points down, so 1-min(0, dot(f,u))
// will be >= 1 and increase the effective maxEdgeDist
wantedViewRange = std::max(wantedViewRange, (1.0f - std::min(0.0f, forward.dot(UpVector))) * maxEdgeDist);

#if 0
wantedViewRange = std::max(wantedViewRange, CGround::LinePlaneCol(pos, tlPixelDir, SQ_MAX_VIEW_RANGE, mapMinHeight));
@@ -184,7 +184,7 @@ CGlobalRendering::CGlobalRendering()

// sane defaults
, minViewRange(MIN_ZNEAR_DIST * 8.0f)
, maxViewRange(MAX_VIEW_RANGE * 0.25f)
, maxViewRange(MAX_VIEW_RANGE * 0.5f)
, aspectRatio(1.0f)

, gammaExponent(1.0f)

0 comments on commit da1b511

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