game: fix occasional missing ground

This commit is contained in:
Crypto City 2022-07-01 19:58:45 +00:00
parent 776b3f8457
commit b3c9abebf4

View File

@ -37,7 +37,9 @@ void FreeCamera::update(float timeStep)
float distance = 0.25f;
while (distance <= 256.0f)
{
Sphere sphere(position(), distance * 2.0f);
// apparent bug in urho3d, stuff at more than the near clip gets clipped, eg:
// 1657zNpVhaTPaqkr5QjdHH, bottom left at ~600, clipped with a 512 near clip plane
Sphere sphere(position(), distance * 2.5f);
SphereOctreeQuery query(results, sphere, DRAWABLE_GEOMETRY);
octree->GetDrawables(query);
bool hit = false;