Grid3DSpatial Module
Nested modules
| Modules | Description |
|
Internal helpers for A* pathfinding. Not intended for direct use. |
Functions and values
| Function or value |
Description
|
Full Usage:
distanceChebyshev x1 y1 z1 x2 y2 z2
Parameters:
^a
y1 : ^c
z1 : ^e
x2 : ^b
y2 : ^d
z2 : ^f
Returns: int
Modifiers: inline Type parameters: ^a, ^b, ^c, ^d, ^e, ^f |
Chebyshev distance in 3D (diagonal = 1).
|
Full Usage:
distanceEuclidean x1 y1 z1 x2 y2 z2
Parameters:
^a
y1 : ^d
z1 : ^g
x2 : ^b
y2 : ^e
z2 : ^h
Returns: float32
Modifiers: inline Type parameters: ^a, ^b, ^c, ^d, ^e, ^f, ^g, ^h, ^i |
Euclidean distance in 3D.
|
Full Usage:
distanceManhattan x1 y1 z1 x2 y2 z2
Parameters:
^a
y1 : ^f
z1 : ^j
x2 : ^b
y2 : ^e
z2 : ^i
Returns: int
Modifiers: inline Type parameters: ^a, ^b, ^c, ^d, ^e, ^f, ^g, ^h, ^i, ^j |
Manhattan distance in 3D.
|
Full Usage:
findPath startX startY startZ goalX goalY goalZ isPassable costFn grid
Parameters:
int
startY : int
startZ : int
goalX : int
goalY : int
goalZ : int
isPassable : int -> int -> int -> bool
costFn : int -> int -> int -> int -> int -> int -> float32
grid : CellGrid3D<'T>
Returns: (int * int * int)[] voption
Modifiers: inline Type parameters: 'T |
A* pathfinding on a 3D voxel grid. Returns the shortest path as an array of coordinates, or ValueNone if no path exists.
|
Full Usage:
floodFill x y z predicate grid
Parameters:
int
y : int
z : int
predicate : int -> int -> int -> bool
grid : CellGrid3D<'T>
Returns: (int * int * int)[]
Modifiers: inline Type parameters: 'T |
Flood fill from (x, y, z) using BFS over 6-connected neighbors.
|
Full Usage:
inRange x y z range grid
Parameters:
int32
y : int32
z : int32
range : int
grid : CellGrid3D<'T>
Returns: (int * int * int)[]
Modifiers: inline Type parameters: 'T |
Returns all cells within Chebyshev distance `range` of (x, y, z).
|
Full Usage:
lineOfSight x1 y1 z1 x2 y2 z2 isBlocked grid
Parameters:
int
y1 : int
z1 : int
x2 : int
y2 : int
z2 : int
isBlocked : int -> int -> int -> bool
grid : CellGrid3D<'T>
Returns: bool
Modifiers: inline Type parameters: 'T |
Returns true if a 3D line from (x1,y1,z1) to (x2,y2,z2) is clear of blocked cells. Uses 3D Bresenham. Start not checked; goal IS checked.
|
Full Usage:
lineOfSightCells x1 y1 z1 x2 y2 z2 isBlocked grid
Parameters:
int
y1 : int
z1 : int
x2 : int
y2 : int
z2 : int
isBlocked : int -> int -> int -> bool
grid : CellGrid3D<'T>
Returns: (int * int * int)[]
Modifiers: inline Type parameters: 'T |
Returns the visible cells along a 3D line from (x1,y1,z1) toward (x2,y2,z2), stopping at the first blocked cell.
|
Full Usage:
neighbors26 x y z grid
Parameters:
int32
y : int32
z : int32
grid : CellGrid3D<'T>
Returns: (int * int * int)[]
Modifiers: inline Type parameters: 'T |
Returns the 26 surrounding neighbors (face + edge + corner).
|
Full Usage:
neighbors6 x y z grid
Parameters:
int
y : int
z : int
grid : CellGrid3D<'T>
Returns: (int * int * int)[]
Modifiers: inline Type parameters: 'T |
Returns the 6 face-adjacent neighbors of (x, y, z).
|
Full Usage:
worldToCell worldPos grid
Parameters:
Vector3
grid : CellGrid3D<'T>
Returns: (int * int * int) voption
Modifiers: inline Type parameters: 'T |
Converts a world position to the nearest grid cell. Returns ValueNone if the position is outside the grid.
|
Mibo