mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 14:36:39 +00:00
parent
c0d3804b4f
commit
3b231b85bb
1 changed files with 3 additions and 3 deletions
|
@ -53,13 +53,13 @@ namespace
|
||||||
{
|
{
|
||||||
assert(grid && !grid->mPoints.empty());
|
assert(grid && !grid->mPoints.empty());
|
||||||
|
|
||||||
float closestDistanceBetween = distanceSquared(grid->mPoints[0], pos);
|
float closestDistanceBetween = FLT_MAX;
|
||||||
float closestDistanceReachable = closestDistanceBetween;
|
float closestDistanceReachable = FLT_MAX;
|
||||||
int closestIndex = 0;
|
int closestIndex = 0;
|
||||||
int closestReachableIndex = 0;
|
int closestReachableIndex = 0;
|
||||||
// TODO: if this full scan causes performance problems mapping pathgrid
|
// TODO: if this full scan causes performance problems mapping pathgrid
|
||||||
// points to a quadtree may help
|
// points to a quadtree may help
|
||||||
for(unsigned int counter = 1; counter < grid->mPoints.size(); counter++)
|
for(unsigned int counter = 0; counter < grid->mPoints.size(); counter++)
|
||||||
{
|
{
|
||||||
float potentialDistBetween = distanceSquared(grid->mPoints[counter], pos);
|
float potentialDistBetween = distanceSquared(grid->mPoints[counter], pos);
|
||||||
if (potentialDistBetween < closestDistanceReachable)
|
if (potentialDistBetween < closestDistanceReachable)
|
||||||
|
|
Loading…
Reference in a new issue