Skip to content

Commit

Permalink
Keep using the m_clipCentroid for now
Browse files Browse the repository at this point in the history
  • Loading branch information
fluffyfreak committed Nov 17, 2024
1 parent 985e1ce commit 2f14e8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/GeoPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f14e8a

Please sign in to comment.