5 releases

0.8.3 May 20, 2021
0.8.2 Feb 17, 2020
0.8.1 Jan 31, 2020
0.8.0 Jan 31, 2020
0.7.0 Nov 23, 2019
Download history 36/week @ 2021-04-02 15/week @ 2021-04-09 24/week @ 2021-04-16 15/week @ 2021-04-23 14/week @ 2021-04-30 6/week @ 2021-05-07 18/week @ 2021-05-14 14/week @ 2021-05-21 9/week @ 2021-05-28 12/week @ 2021-06-04 19/week @ 2021-06-11 6/week @ 2021-06-18 8/week @ 2021-06-25 15/week @ 2021-07-02 12/week @ 2021-07-09 12/week @ 2021-07-16

64 downloads per month
Used in 2 crates (via oxygengine-navigation)

Custom license

85KB
2K SLoC

NavMesh travis-ci status crates-io version

Nav-Mesh path finder for Rust

Installation

Cargo.toml

[dependencies]
navmesh = "0.8"

Example

use navmesh::*;

let vertices = vec![
    (0.0, 0.0, 0.0).into(), // 0
    (1.0, 0.0, 0.0).into(), // 1
    (2.0, 0.0, 1.0).into(), // 2
    (0.0, 1.0, 0.0).into(), // 3
    (1.0, 1.0, 0.0).into(), // 4
    (2.0, 1.0, 1.0).into(), // 5
];
let triangles = vec![
    (0, 1, 4).into(), // 0
    (4, 3, 0).into(), // 1
    (1, 2, 5).into(), // 2
    (5, 4, 1).into(), // 3
];

let mesh = NavMesh::new(vertices, triangles).unwrap();
let path = mesh
    .find_path(
        (0.0, 1.0, 0.0).into(),
        (1.5, 0.25, 0.5).into(),
        NavQuery::Accuracy,
        NavPathMode::MidPoints,
    )
    .unwrap();
assert_eq!(
    path.into_iter()
        .map(|v| (
            (v.x * 10.0) as i32,
            (v.y * 10.0) as i32,
            (v.z * 10.0) as i32,
        ))
        .collect::<Vec<_>>(),
    vec![(0, 10, 0), (10, 5, 0), (15, 2, 5),]
);

Dependencies

~7MB
~153K SLoC