Skip to content

Commit

Permalink
Rename near to zNear
Browse files Browse the repository at this point in the history
`near` is an illegal variable name on Windows (if `windef.h` is included),
because a macro with the same name is defined.

Someone else already put your rage into words, see
http://lolengine.net/blog/2011/3/4/fuck-you-microsoft-near-far-macros.
  • Loading branch information
fegorschIGD committed May 15, 2018
1 parent 1b58857 commit 78392f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/ovis/src/ovis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ static void _setCameraIntrinsics(Camera* cam, InputArray _K, const Size& imsize)

Matx33f K = _K.getMat();

float near = cam->getNearClipDistance();
float top = near * K(1, 2) / K(1, 1);
float left = -near * K(0, 2) / K(0, 0);
float right = near * (imsize.width - K(0, 2)) / K(0, 0);
float bottom = -near * (imsize.height - K(1, 2)) / K(1, 1);
float zNear = cam->getNearClipDistance();
float top = zNear * K(1, 2) / K(1, 1);
float left = -zNear * K(0, 2) / K(0, 0);
float right = zNear * (imsize.width - K(0, 2)) / K(0, 0);
float bottom = -zNear * (imsize.height - K(1, 2)) / K(1, 1);

// use frustum extents instead of setFrustumOffset as the latter
// assumes centered FOV, which is not the case
Expand Down

0 comments on commit 78392f7

Please sign in to comment.