parsing of SourceEngine .nav files
  • Rust 97.9%
  • Nix 2.1%
Find a file
2025-05-30 19:18:43 +02:00
.forgejo/workflows ci 2025-05-30 17:23:48 +02:00
benches use file/buffreader in docs 2025-05-30 18:50:38 +02:00
data initial port 2020-04-30 20:00:11 +02:00
src msrv 2025-05-30 19:18:43 +02:00
.envrc flake 2025-05-30 17:23:14 +02:00
.gitignore flake 2025-05-30 17:23:14 +02:00
Cargo.lock msrv 2025-05-30 19:18:43 +02:00
Cargo.toml msrv 2025-05-30 19:18:43 +02:00
flake.lock flake 2025-05-30 17:23:14 +02:00
flake.nix use file/buffreader in docs 2025-05-30 18:50:38 +02:00
LICENSE specify licence 2020-05-01 00:27:20 +02:00
README.md use file/buffreader in docs 2025-05-30 18:50:38 +02:00

SourceNav

parsing of SourceEngine .nav files

Usage

This library is currently focused on getting the z-height from an x/y coordinate in a map and the api is tailored towards that usage. For other usages the raw navigation areas are exposed.

use sourcenav::get_quad_tree;
use std::fs::File;
use std::io::BufReader;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut file = BufReader::new(File::open("data/pl_badwater.nav")?);
    let tree = get_quad_tree(&mut file)?;

    assert_eq!(220.83125,  tree.find_best_height(320.0, -1030.0, 0.0));

    Ok(())
}

Credits and Licence

This library is largely based on gonav, a parser for .nav files written in Go and is licenced under AGPL-3.0.