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());

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.
ClusterId
Identifier for a cluster in the grid hierarchy.
CrowdSimulation
Crowd simulation with density-aware velocity damping.
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.
GridClusters
Grid clustering for HPA*.
GridPos
A position on the navigation grid.
HalfPlane
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.
NavPolyId
Unique identifier for a navigation polygon.
Obstacle
A circular obstacle for avoidance steering.
PathFollower
Follows a sequence of waypoints, advancing to the next when close enough.
PathRequest
A pathfinding request.
PathResult
Result of a pathfinding computation.
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.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.

Enums§

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.
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.