Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoPatch/GeoSphere refactoring #5979

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void Camera::Update()

// cull off-screen objects
double rad = b->GetClipRadius();
if (!m_context->GetFrustum().TestPointInfinite(attrs.viewCoords, rad))
if (!m_context->GetFrustum().TestSphereInfinite(attrs.viewCoords, rad))
continue;

attrs.camDist = attrs.viewCoords.Length();
Expand Down
4 changes: 2 additions & 2 deletions src/CityOnPlanet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void CityOnPlanet::Render(Graphics::Renderer *r, const CameraContext *camera, co
// Early frustum test of whole city.
const vector3d stationPos = viewTransform * (station->GetPosition() + m_realCentre);

if (!camera->GetFrustum().TestPoint(stationPos, m_clipRadius))
if (!camera->GetFrustum().TestSphere(stationPos, m_clipRadius))
return;

// Use the station-centered frame-oriented coordinate system we generated building positions in
Expand Down Expand Up @@ -736,7 +736,7 @@ void CityOnPlanet::Render(Graphics::Renderer *r, const CameraContext *camera, co
for (size_t i = 0; i < m_enabledBuildings.size(); i++) {
const auto &building = m_enabledBuildings[i];

if (!frustum.TestPoint(building.pos, building.clipRadius))
if (!frustum.TestSphere(building.pos, building.clipRadius))
continue;

transform[building.instIndex].emplace_back(m_instanceTransforms[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/GasGiant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class GasPatch {

void Render(Graphics::Renderer *renderer, const vector3d &campos, const matrix4x4d &modelView, const Graphics::Frustum &frustum)
{
if (!frustum.TestPoint(clipCentroid, clipRadius))
if (!frustum.TestSphere(clipCentroid, clipRadius))
return;

const vector3d relpos = clipCentroid - campos;
Expand Down
Loading