mirror of
https://github.com/recastnavigation/recastnavigation.git
synced 2026-09-29 13:36:22 +00:00
Added more bits to compact neighbour indices, moved region id to rcCompactSpan to save memory.
This commit is contained in:
@@ -638,6 +638,37 @@ int main(int argc, char *argv[])
|
||||
showSample = false;
|
||||
}
|
||||
|
||||
if (geom || sample)
|
||||
{
|
||||
const float* bmin = 0;
|
||||
const float* bmax = 0;
|
||||
if (sample)
|
||||
{
|
||||
bmin = sample->getBoundsMin();
|
||||
bmax = sample->getBoundsMax();
|
||||
}
|
||||
else if (geom)
|
||||
{
|
||||
bmin = geom->getMeshBoundsMin();
|
||||
bmax = geom->getMeshBoundsMax();
|
||||
}
|
||||
// Reset camera and fog to match the mesh bounds.
|
||||
if (bmin && bmax)
|
||||
{
|
||||
camr = sqrtf(rcSqr(bmax[0]-bmin[0]) +
|
||||
rcSqr(bmax[1]-bmin[1]) +
|
||||
rcSqr(bmax[2]-bmin[2])) / 2;
|
||||
camx = (bmax[0] + bmin[0]) / 2 + camr;
|
||||
camy = (bmax[1] + bmin[1]) / 2 + camr;
|
||||
camz = (bmax[2] + bmin[2]) / 2 + camr;
|
||||
camr *= 3;
|
||||
}
|
||||
rx = 45;
|
||||
ry = -45;
|
||||
glFogf(GL_FOG_START, camr*0.2f);
|
||||
glFogf(GL_FOG_END, camr*1.25f);
|
||||
}
|
||||
|
||||
imguiEndScrollArea();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user