Crates.io | sourcenav |
lib.rs | sourcenav |
version | 0.2.0 |
source | src |
created_at | 2020-04-30 22:30:26.421024 |
updated_at | 2020-05-02 12:50:36.272676 |
description | parsing of SourceEngine .nav files |
homepage | |
repository | https://github.com/icewind1991/sourcenav |
max_upload_size | |
id | 235970 |
size | 1,168,749 |
parsing of SourceEngine .nav
files
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;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let file = std::fs::read("data/pl_badwater.nav")?;
let tree = get_quad_tree(file)?;
assert_eq!(220.83125, tree.find_best_height(320.0, -1030.0, 0.0));
Ok(())
}
This library is largely based on gonav, a parser for .nav
files written in Go
and is licenced under AGPL-3.0.