From 78392f786da6d3871590c62d88e6ba323d834e5b Mon Sep 17 00:00:00 2001 From: fegorsch Date: Tue, 15 May 2018 15:43:15 +0200 Subject: [PATCH] Rename `near` to `zNear` `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. --- modules/ovis/src/ovis.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ovis/src/ovis.cpp b/modules/ovis/src/ovis.cpp index 9f43211c5..6ceeec544 100644 --- a/modules/ovis/src/ovis.cpp +++ b/modules/ovis/src/ovis.cpp @@ -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