Skip to main content

Crate raasta

Crate raasta 

Source
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§

AbstractGraph
Abstract graph for hierarchical pathfinding.
AbstractNodeId
A node in the abstract graph — represents one side of an entrance.
Agent
A navigation agent with position, velocity, and optional path following.
AreaCostMultiplier
Per-agent area cost multiplier.
BatchedResult
A completed path result with its request ID.
CarvedObstacle
A carved obstacle shape.
CarvedObstacleId
Unique identifier for a carved obstacle.
ClusterId
Identifier for a cluster in the grid hierarchy.
ColliderNavConfig
Configuration for collider-based navmesh generation.
CrowdSimulation
Crowd simulation with density-aware velocity damping.
DStarLite
D* Lite incremental pathfinder.
DebugDraw
Collects debug geometry for visualization.
DebugLine
A colored line segment for debug rendering.
DebugPoint
A colored point for debug rendering.
Entrance
An entrance between two adjacent clusters.
Formation
A formation manager for group movement.
GlobalPolyId
A globally unique polygon ID combining tile coordinate and local polygon index.
GridClusters
Grid clustering for HPA*.
GridPathQuery
A reusable A* query object with pre-allocated scratch buffers.
GridPos
A position on the navigation grid.
HalfPlane
A half-plane constraint: all velocities v where (v - point) · normal ≥ 0.
HeightSpan
A span in a heightfield column — a vertical range that is solid.
Heightfield
A heightfield — voxelized representation of 3D geometry.
HeightfieldConfig
Baking configuration for heightfield navmesh generation.
IncrementalGridPath
An incremental (time-sliced) A* pathfinding query.
InfluenceMap
A 2D influence map grid for annotating areas with scalar values.
LayerConnection
Connection between layers (stairs, elevators, ramps).
LayerId
Identifies a layer in the multi-layer navmesh.
LayeredPolyId
A polygon ID scoped to a specific layer.
MultiLayerNavMesh
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.
NavPolyId
Unique identifier for a navigation polygon.
NavQueryFilter
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.
ObstacleCarver
Runtime obstacle carving for navmesh polygons.
OffMeshLink
An off-mesh link connecting two positions on the navmesh.
OffMeshLinkDesc
Description of an off-mesh link to add to a registry.
OffMeshLinkId
Unique identifier for an off-mesh link.
OffMeshLinkRegistry
Registry of off-mesh links for a navmesh.
PathBatcher
Batched path request processor.
PathCorridor
A path corridor — a sequence of navmesh polygons from start to goal with position tracking and local replanning support.
PathFollower
Follows a sequence of waypoints, advancing to the next when close enough.
PathRequest
A pathfinding request.
PathRequestId
Unique identifier for a batched path request.
PathResult
Result of a pathfinding computation.
Portal
A portal edge between two adjacent navmesh polygons.
PrioritizedSteer
A prioritized steering behavior entry.
QueuedRequest
A queued path request with priority.
RequestPriority
Priority level for a path request (lower number = higher priority).
RvoAgent
An RVO agent with position, velocity, and radius.
RvoSimulation
Multi-agent RVO simulation.
SteerOutput
Output of a steering computation.
SteerOutput3D
Output of a 3D steering computation.
TileCoord
Identifies a tile by its grid coordinates.
TiledNavMesh
A tiled navmesh for open-world navigation.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.
VoxelPos
A position in the voxel grid.
WeightedSteer
A weighted steering behavior entry for blending.

Enums§

CarveShape
Shape to carve from the navmesh.
ColliderShape
A collider shape for navmesh generation.
FormationShape
A formation shape defining slot positions relative to the leader.
IncrementalStatus
Status of an incremental pathfinding query.
LinkType
The type of traversal an off-mesh link represents.
NavError
Errors that can occur during navigation operations.
PathStatus
Status of a pathfinding request.
SteerBehavior
A steering behavior that produces a desired velocity/force.
SteerBehavior3D
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.