Expand description
§Raasta
Raasta (راستہ — Urdu/Hindi for “path/way/route”) — navigation and pathfinding engine for the AGNOS ecosystem.
Provides navmesh generation, A* pathfinding, grid-based search, flow fields,
path smoothing, and steering behaviors. Built on hisab for math.
§Features
- NavMesh — polygon-based navigation mesh with connectivity graph
- A* pathfinding — optimal shortest-path on navmesh or grid
- Grid pathfinding — 2D grid with walkability and costs
- Flow fields — precomputed direction fields for crowd movement
- Path smoothing — funnel algorithm for natural-looking paths
- Steering behaviors — seek, flee, arrive, obstacle avoidance
§Example
use raasta::{NavGrid, GridPos};
let mut grid = NavGrid::new(10, 10, 1.0);
grid.set_walkable(5, 3, false); // place a wall
let path = grid.find_path(GridPos::new(0, 0), GridPos::new(9, 9));
assert!(path.is_some());Structs§
- Abstract
Graph - Abstract graph for hierarchical pathfinding.
- Abstract
Node Id - A node in the abstract graph — represents one side of an entrance.
- Agent
- A navigation agent with position, velocity, and optional path following.
- Cluster
Id - Identifier for a cluster in the grid hierarchy.
- Crowd
Simulation - Crowd simulation with density-aware velocity damping.
- Debug
Draw - Collects debug geometry for visualization.
- Debug
Line - A colored line segment for debug rendering.
- Debug
Point - A colored point for debug rendering.
- Entrance
- An entrance between two adjacent clusters.
- Grid
Clusters - Grid clustering for HPA*.
- GridPos
- A position on the navigation grid.
- Half
Plane - A half-plane constraint: all velocities v where
(v - point) · normal ≥ 0. - NavGrid
- A 2D navigation grid with walkability and movement costs.
- NavMesh
- A navigation mesh composed of convex polygons.
- NavMesh3D
- A 3D navigation mesh.
- NavPoly
- A convex polygon in the navigation mesh.
- NavPoly3D
- A convex polygon in 3D space.
- NavPoly
Id - Unique identifier for a navigation polygon.
- Obstacle
- A circular obstacle for avoidance steering.
- Path
Follower - Follows a sequence of waypoints, advancing to the next when close enough.
- Path
Request - A pathfinding request.
- Path
Result - Result of a pathfinding computation.
- RvoAgent
- An RVO agent with position, velocity, and radius.
- RvoSimulation
- Multi-agent RVO simulation.
- Steer
Output - Output of a steering computation.
- Steer
Output3D - Output of a 3D steering computation.
- Vec2
- A 2-dimensional vector.
- Vec3
- A 3-dimensional vector.
Enums§
- Path
Status - Status of a pathfinding request.
- Steer
Behavior - A steering behavior that produces a desired velocity/force.
- Steer
Behavior3D - A 3D steering behavior.
Functions§
- alignment
- Compute alignment steering — steer toward the average heading of neighbors.
- avoid_
obstacles - Compute an avoidance steering force away from nearby obstacles.
- cohesion
- Compute cohesion steering — steer toward the center of mass of neighbors.
- compute_
orca_ half_ plane - Compute the ORCA half-plane constraint between two agents.
- compute_
steer - Compute steering output for the given behavior.
- compute_
steer_ 3d - Compute 3D steering output for the given behavior.
- evade
- Compute evasion steering — flee from a moving target’s predicted future position.
- funnel_
smooth - Apply the simple string-pulling (funnel) smoothing algorithm.
- merge_
convex - Merge a set of triangles into larger convex polygons.
- pursuit
- Compute pursuit steering — intercept a moving target by predicting its future position.
- separation
- Compute separation steering — steer away from nearby neighbors.
- solve_
velocity - Solve for the optimal velocity given ORCA half-plane constraints.
- triangulate
- Triangulate a simple polygon using the ear-clipping algorithm.
- triangulate_
points - Triangulate and return the actual triangle vertices (not indices).
- wander
- Compute wander steering — natural-looking random movement.