stdlib/navmeshView source ↗
navmesh
18 items · generated by scribe fromstdlib/navmesh.fd· synced 2026-11-15
Contents
- NavGrid (struct)
- nav_grid_create (function)
- nav_grid_set_blocked (function)
- nav_grid_is_blocked (function)
- nav_grid_index (function)
- nav_grid_unpack (function)
- AStarNode (struct)
- nav_grid_find_path (function)
- nav_grid_path_length (function)
- nav_grid_path_waypoint (function)
- NavPoly (struct)
- NavMesh (struct)
- navmesh_create (function)
- navmesh_add_polygon (function)
- navmesh_connect (function)
- navmesh_find_path (function)
- navmesh_poly_center (function)
- navmesh_poly_count (function)
NavGrid
pub struct NavGrid {Fields:
| Name | Type |
|---|---|
width | i64 |
height | i64 |
cells | Vec<bool> |
Defined at line 20
nav_grid_create
pub fn nav_grid_create(width: i64, height: i64) -> NavGrid {Parameters:
width:i64height:i64
Returns: NavGrid
Defined at line 26
nav_grid_set_blocked
pub fn nav_grid_set_blocked(grid: & mut NavGrid, x: i64, y: i64, blocked: bool) -> void {Parameters:
grid:& mut NavGridx:i64y:i64blocked:bool
Returns: void
Defined at line 38
nav_grid_is_blocked
pub fn nav_grid_is_blocked(grid: & NavGrid, x: i64, y: i64) -> bool {Parameters:
grid:& NavGridx:i64y:i64
Returns: bool
Defined at line 45
nav_grid_index
pub fn nav_grid_index(x: i64, y: i64) -> i64 {Parameters:
x:i64y:i64
Returns: i64
Defined at line 52
nav_grid_unpack
pub fn nav_grid_unpack(idx: i64) -> vec2 {Parameters:
idx:i64
Returns: vec2
Defined at line 57
AStarNode
pub struct AStarNode {Fields:
| Name | Type |
|---|---|
x | i64 |
y | i64 |
g | f64 |
h | f64 |
f | f64 |
parent_x | i64 |
parent_y | i64 |
open | bool |
closed | bool |
Defined at line 62
nav_grid_find_path
Find a path on the grid using A*. Returns a Vec
pub fn nav_grid_find_path(grid: & NavGrid, start_x: i64, start_y: i64, goal_x: i64, goal_y: i64) -> Vec<i64> {Parameters:
grid:& NavGridstart_x:i64start_y:i64goal_x:i64goal_y:i64
Returns: Vec<i64>
Defined at line 78
nav_grid_path_length
Get the path length (number of waypoints).
pub fn nav_grid_path_length(path: Vec<i64>) -> i64 {Parameters:
path:Vec<i64>
Returns: i64
Defined at line 235
nav_grid_path_waypoint
Get a waypoint from the path.
pub fn nav_grid_path_waypoint(path: Vec<i64>, idx: i64) -> vec2 {Parameters:
path:Vec<i64>idx:i64
Returns: vec2
Defined at line 240
NavPoly
pub struct NavPoly {Fields:
| Name | Type |
|---|---|
id | i64 |
center_x | f64 |
center_y | f64 |
neighbors | Vec<i64> |
Defined at line 249
NavMesh
pub struct NavMesh {Fields:
| Name | Type |
|---|---|
polygons | Vec<NavPoly> |
Defined at line 256
navmesh_create
pub fn navmesh_create() -> NavMesh {Returns: NavMesh
Defined at line 260
navmesh_add_polygon
Add a polygon to the navmesh. Returns the polygon ID.
pub fn navmesh_add_polygon(mesh: & mut NavMesh, center_x: f64, center_y: f64) -> i64 {Parameters:
mesh:& mut NavMeshcenter_x:f64center_y:f64
Returns: i64
Defined at line 267
navmesh_connect
Connect two polygons (bidirectional).
pub fn navmesh_connect(mesh: & mut NavMesh, a: i64, b: i64) -> void {Parameters:
mesh:& mut NavMesha:i64b:i64
Returns: void
Defined at line 276
navmesh_find_path
Find a path between two polygons using A*.
pub fn navmesh_find_path(mesh: & NavMesh, start: i64, goal: i64) -> Vec<i64> {Parameters:
mesh:& NavMeshstart:i64goal:i64
Returns: Vec<i64>
Defined at line 292
navmesh_poly_center
Get the center of a polygon.
pub fn navmesh_poly_center(mesh: & NavMesh, id: i64) -> vec2 {Parameters:
mesh:& NavMeshid:i64
Returns: vec2
Defined at line 405
navmesh_poly_count
Get the number of polygons.
pub fn navmesh_poly_count(mesh: & NavMesh) -> i64 {Parameters:
mesh:& NavMesh
Returns: i64
Defined at line 414
Generated by scribe, the Fides documentation generator