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());Modules§
- bridge
- Cross-crate bridges — primitive-value conversions from other AGNOS science crates. Cross-crate bridges — convert primitive values from other AGNOS science crates into raasta navigation parameters and vice versa.
- integration
- Integration APIs for downstream consumers (soorat rendering). Integration APIs for downstream consumers.
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.
- Area
Cost Multiplier - Per-agent area cost multiplier.
- Batched
Result - A completed path result with its request ID.
- Carved
Obstacle - A carved obstacle shape.
- Carved
Obstacle Id - Unique identifier for a carved obstacle.
- Cluster
Id - Identifier for a cluster in the grid hierarchy.
- Collider
NavConfig - Configuration for collider-based navmesh generation.
- Crowd
Simulation - Crowd simulation with density-aware velocity damping.
- DStar
Lite - D* Lite incremental pathfinder.
- 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.
- Formation
- A formation manager for group movement.
- Global
Poly Id - A globally unique polygon ID combining tile coordinate and local polygon index.
- Grid
Clusters - Grid clustering for HPA*.
- Grid
Path Query - A reusable A* query object with pre-allocated scratch buffers.
- GridPos
- A position on the navigation grid.
- Half
Plane - A half-plane constraint: all velocities v where
(v - point) · normal ≥ 0. - Height
Span - A span in a heightfield column — a vertical range that is solid.
- Heightfield
- A heightfield — voxelized representation of 3D geometry.
- Heightfield
Config - Baking configuration for heightfield navmesh generation.
- Incremental
Grid Path - An incremental (time-sliced) A* pathfinding query.
- Influence
Map - A 2D influence map grid for annotating areas with scalar values.
- Layer
Connection - Connection between layers (stairs, elevators, ramps).
- LayerId
- Identifies a layer in the multi-layer navmesh.
- Layered
Poly Id - A polygon ID scoped to a specific layer.
- Multi
Layer NavMesh - Multi-layer navmesh — multiple overlapping navigation surfaces.
- 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.
- NavQuery
Filter - Filter for including/excluding polygons during pathfinding queries.
- NavTile
- A tile containing its own local navmesh.
- NavVolume
- A 3D navigation volume (voxel grid).
- Obstacle
- A circular obstacle for avoidance steering.
- Obstacle
Carver - Runtime obstacle carving for navmesh polygons.
- OffMesh
Link - An off-mesh link connecting two positions on the navmesh.
- OffMesh
Link Desc - Description of an off-mesh link to add to a registry.
- OffMesh
Link Id - Unique identifier for an off-mesh link.
- OffMesh
Link Registry - Registry of off-mesh links for a navmesh.
- Path
Batcher - Batched path request processor.
- Path
Corridor - A path corridor — a sequence of navmesh polygons from start to goal with position tracking and local replanning support.
- Path
Follower - Follows a sequence of waypoints, advancing to the next when close enough.
- Path
Request - A pathfinding request.
- Path
Request Id - Unique identifier for a batched path request.
- Path
Result - Result of a pathfinding computation.
- Portal
- A portal edge between two adjacent navmesh polygons.
- Prioritized
Steer - A prioritized steering behavior entry.
- Queued
Request - A queued path request with priority.
- Request
Priority - Priority level for a path request (lower number = higher priority).
- 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.
- Tile
Coord - Identifies a tile by its grid coordinates.
- Tiled
NavMesh - A tiled navmesh for open-world navigation.
- Vec2
- A 2-dimensional vector.
- Vec3
- A 3-dimensional vector.
- Voxel
Pos - A position in the voxel grid.
- Weighted
Steer - A weighted steering behavior entry for blending.
Enums§
- Carve
Shape - Shape to carve from the navmesh.
- Collider
Shape - A collider shape for navmesh generation.
- Formation
Shape - A formation shape defining slot positions relative to the leader.
- Incremental
Status - Status of an incremental pathfinding query.
- Link
Type - The type of traversal an off-mesh link represents.
- NavError
- Errors that can occur during navigation operations.
- 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.
- bake_
from_ heightfield - Bake a 2D NavMesh from a heightfield.
- bake_
navmesh_ from_ geometry - Full pipeline: rasterize triangles and bake a navmesh.
- blend_
priority - Select steering output by priority groups.
- blend_
weighted - Blend multiple steering outputs by weighted sum.
- 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.
- erode_
navmesh - Erode navmesh polygon vertices inward by
radius. - evade
- Compute evasion steering — flee from a moving target’s predicted future position.
- extract_
portals - Extract portal edges from a navmesh polygon path.
- funnel_
portals - Simple Stupid Funnel Algorithm — compute a smooth path through portal edges.
- funnel_
smooth - Apply the simple string-pulling (funnel) smoothing algorithm.
- merge_
convex - Merge a set of triangles into larger convex polygons.
- navmesh_
from_ colliders - Generate a NavMesh from a walkable boundary with collider obstacles.
- navmesh_
from_ colliders_ rect - Simplified variant: generate navmesh from just collider obstacles within a rectangular area.
- 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.