Get nearest index for LoS calculation.

This commit is contained in:
MobiusDevelopment 2021-04-02 07:32:46 +00:00
parent 09bfec84c7
commit a04a0f244b
23 changed files with 46 additions and 46 deletions

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -565,7 +565,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -573,7 +573,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -565,7 +565,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -573,7 +573,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -565,7 +565,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -573,7 +573,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -565,7 +565,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -573,7 +573,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.

View File

@ -566,7 +566,7 @@ public class GeoEngine
// Check being on same cell and layer (index). // Check being on same cell and layer (index).
// Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self. // Note: Get index must use origin height increased by cell height, the method returns index to height exclusive self.
int index = block.getIndexBelow(gox, goy, oz + GeoStructure.CELL_HEIGHT); int index = block.getIndexNearest(gox, goy, oz + GeoStructure.CELL_HEIGHT); // getIndexBelow
if (index < 0) if (index < 0)
{ {
return false; return false;
@ -574,7 +574,7 @@ public class GeoEngine
if ((gox == gtx) && (goy == gty)) if ((gox == gtx) && (goy == gty))
{ {
return index == block.getIndexBelow(gtx, gty, tz + GeoStructure.CELL_HEIGHT); return index == block.getIndexNearest(gtx, gty, tz + GeoStructure.CELL_HEIGHT); // getIndexBelow
} }
// Get ground and nswe flag. // Get ground and nswe flag.