[][src]Struct sourcenav::NavQuadTree

pub struct NavQuadTree(_);

A tree of all navigation areas

Methods

impl NavQuadTree[src]

pub fn query(&self, x: f32, y: f32) -> impl Iterator<Item = &NavQuad>[src]

Find the navigation areas at a x/y cooordinate

Examples

use sourcenav::get_quad_tree;

let file = std::fs::read("path/to/navfile.nav")?;
let tree = get_quad_tree(file)?;
let areas = tree.query(150.0, -312.0);

pub fn find_z_height<'a>(
    &'a self,
    x: f32,
    y: f32
) -> impl Iterator<Item = f32> + 'a
[src]

Find the z-height of a specfic x/y cooordinate

Note that multiple heights might exist for a given x/y coooridnate

Examples

use sourcenav::get_quad_tree;

let file = std::fs::read("path/to/navfile.nav")?;
let tree = get_quad_tree(file)?;
let heights = tree.find_z_height(150.0, -312.0);

pub fn find_best_height(&self, x: f32, y: f32, z_guess: f32) -> f32[src]

Get the z height at a point

A z-guess should be provided to resolve cases where multiple z values are possible

pub fn quads(&self) -> impl Iterator<Item = &NavQuad>[src]

Get all navigation areas from the nav file

Examples

use sourcenav::get_quad_tree;

let file = std::fs::read("path/to/navfile.nav")?;
let tree = get_quad_tree(file)?;
for quad in tree.quads() {
    println!("area: {:?}", quad)
}

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.