1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2025 Christian Mauduit <ufoot@ufoot.org>
//! 2.5D mesh implementations for layered pathfinding.
//!
//! This module provides structures and traits for pathfinding in "2.5D" spaces - essentially
//! stacked 2D layers with vertical connections between them. Unlike true 3D pathfinding which
//! would support 26 neighbors (including diagonals across layers), this implementation provides
//! a simpler model where each cell has:
//! - 8 in-layer neighbors (like 2D: 4 orthogonal + 4 diagonal)
//! - 2 vertical neighbors (directly above and below)
//!
//! This 2.5D approach is ideal for games with multiple floors, platformers with layers,
//! or any scenario where movement is primarily 2D within a layer but with limited
//! vertical transitions between layers.
//!
//! # Main Types
//!
//! - [`Full25D`] - A fully connected rectangular volume where all cells are walkable.
//! Each cell can connect to its neighbors in the current layer (8 neighbors like 2D)
//! plus cells directly above and below (2 more = 10 total neighbors).
//!
//! - [`Compact25D`] - An optimized 2.5D volume that supports walls/obstacles. It compresses
//! walkable cells and pre-computes successors for memory efficiency.
//!
//! # Traits
//!
//! - [`Shape3D`] - Provides volume dimensions via `shape()` returning `(width, height, depth)`.
//!
//! - [`Index3D`] - Converts between 2.5D coordinates `(x, y, z)` and linear indices.
//!
//! # Example
//!
//! ```
//! use shortestpath::{Gradient, Mesh, mesh_25d::Full25D};
//!
//! // Create a 10x10x10 volume
//! let mesh = Full25D::new(10, 10, 10);
//!
//! // Setup pathfinding with center as target
//! let mut gradient = Gradient::from_mesh(&mesh);
//! gradient.set_distance(555, 0.0); // Center of 10x10x10 volume
//! gradient.spread(&mesh);
//!
//! // Query distance from corner to center
//! let distance = gradient.get_distance(0);
//! println!("Distance from corner to center: {}", distance);
//! ```
pub use *;
pub use *;
// Re-export 3D traits from mesh_3d for convenience
pub use crate;