Skip to content

Commit

Permalink
fix that coarseness test with disks ignored fov
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomáš Malý committed Jan 29, 2019
1 parent 8d73b8d commit 9018b25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion browser/src/vts-libbrowser/camera/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ OldDraw::OldDraw(const TileId &id) : trav(id), orig(id), age(0)

CameraImpl::CameraImpl(MapImpl *map, Camera *cam) :
map(map), camera(cam),
diskNominalDistance(0),
windowWidth(0), windowHeight(0)
{}

Expand Down Expand Up @@ -182,7 +183,7 @@ double CameraImpl::coarsenessValue(TraverseNode *trav)
double dist = distanceToDisk(trav->diskNormalPhys,
trav->diskHeightsPhys, trav->diskHalfAngle,
cameraPosPhys);
double v = texelSize * windowHeight / dist;
double v = texelSize * diskNominalDistance / dist;
assert(v == v && v > 0);
return v;
}
Expand Down Expand Up @@ -571,6 +572,7 @@ void CameraImpl::renderUpdate()
vts::frustumPlanes(viewProjCulling, cullingPlanes);
cameraPosPhys = eye;
focusPosPhys = target;
diskNominalDistance = windowHeight * apiProj(1, 1) * 0.5;
}
else
{
Expand Down
1 change: 1 addition & 0 deletions browser/src/vts-libbrowser/camera/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class CameraImpl
vec3 cameraPosPhys;
vec3 focusPosPhys;
vec3 eye, target, up;
double diskNominalDistance;
uint32 windowWidth;
uint32 windowHeight;

Expand Down

0 comments on commit 9018b25

Please sign in to comment.