diff --git a/src/GeoPatch.cpp b/src/GeoPatch.cpp index b5dd7f804f..d6aea29d69 100644 --- a/src/GeoPatch.cpp +++ b/src/GeoPatch.cpp @@ -447,15 +447,15 @@ void GeoPatch::ReceiveJobHandle(Job::Handle job) bool GeoPatch::IsOverHorizon(const vector3d &camPos) { - const vector3d camDir(camPos - m_centroid); + const vector3d camDir(camPos - m_clipCentroid); const vector3d camDirNorm(camDir.Normalized()); - const vector3d cenDir(m_centroid.Normalized()); + const vector3d cenDir(m_clipCentroid.Normalized()); const double dotProd = camDirNorm.Dot(cenDir); if (dotProd < 0.25 && (camDir.LengthSqr() > (m_clipRadius * m_clipRadius))) { // return the result of the Horizon Culling test, inverted to match naming semantic // eg: HC returns true==visible, but this method returns true==hidden - return !s_sph.HorizonCulling(camPos, SSphere(m_centroid, m_clipRadius)); + return !s_sph.HorizonCulling(camPos, SSphere(m_clipCentroid, m_clipRadius)); } // not over the horizon