PointClickEngine::Navigation::Pathfinding
Inherits Reference < Object
Pathfinding system using component-based architecture
This Pathfinding class delegates responsibilities to specialized components:
- NavigationGrid: Grid management and walkable areas
- AStarAlgorithm: Core A* pathfinding implementation
- PathOptimizer: Path smoothing and optimization
- HeuristicCalculator: Distance calculation strategies
- MovementValidator: Movement rules and validation
- PathfindingDebugRenderer: Debug visualization
Constructors
Instance methods
algorithm
Sourcealgorithm=(algorithm : AStarAlgorithm)
Sourceconfigure(allow_diagonal : Bool | Nil = nil, prevent_corner_cutting : Bool | Nil = nil, heuristic_method : HeuristicCalculator::Method | Nil = nil, max_search_nodes : Int32 | Nil = nil)
Updates pathfinding settings
debug_renderer
Sourcedebug_renderer=(debug_renderer : PathfindingDebugRenderer)
Sourcedraw_character_info(character_pos : RL::Vector2, target_pos : RL::Vector2 | Nil = nil)
Sourcedraw_grid(color_walkable : RL::Color = RL::GREEN, color_blocked : RL::Color = RL::RED, alpha : UInt8 = 100_u8)
Debug rendering methods
draw_grid_stats(x : Int32 = 10, y : Int32 = 10)
Sourcedraw_path(path : Array(RL::Vector2), color : RL::Color = RL::YELLOW, thickness : Float32 = 3.0_f32)
Sourcedraw_performance_info(x : Int32, y : Int32, path_length : Float32)
Sourceenable_debug=(enable_debug : Bool)
Sourceestimate_path_cost(start_x : Float32, start_y : Float32, end_x : Float32, end_y : Float32) : Float32
Calculates approximate path cost without finding full path
find_closest_point_on_path(path : Array(RL::Vector2), position : RL::Vector2) : NamedTuple(point: RL::Vector2, index: Int32, distance: Float32)
Finds closest point on path to a given position
find_partial_path(start_x : Float32, start_y : Float32, end_x : Float32, end_y : Float32, max_distance : Float32 = 100.0_f32) : Array(RL::Vector2) | Nil
Finds partial path when full path is not available
find_path(start_x : Float32, start_y : Float32, end_x : Float32, end_y : Float32) : Array(RL::Vector2) | Nil
Finds an optimal path between two world positions
find_path(start_pos : RL::Vector2, end_pos : RL::Vector2) : Array(RL::Vector2) | Nil
Finds path using Vector2 positions
find_path_with_optimization(start_x : Float32, start_y : Float32, end_x : Float32, end_y : Float32, optimization : Symbol = :normal) : Array(RL::Vector2) | Nil
Finds path with specific optimization level
is_path_valid?(path : Array(RL::Vector2)) : Bool
Validates if an existing path is still walkable
optimizer
Sourceoptimizer=(optimizer : PathOptimizer)
Sourcepath_exists?(start_x : Float32, start_y : Float32, end_x : Float32, end_y : Float32) : Bool
Checks if a path exists without returning the full path
path_exists?(start_pos : RL::Vector2, end_pos : RL::Vector2) : Bool
Checks if a path exists using Vector2 positions