[][src]Struct sourcenav::NavQuad

pub struct NavQuad {
    pub north_west: Vector3,
    pub south_east: Vector3,
    pub north_east_z: f32,
    pub south_west_z: f32,
}

A navigation area from the nav file

Fields

north_west: Vector3south_east: Vector3north_east_z: f32south_west_z: f32

Methods

impl NavQuad[src]

pub fn width(&self) -> f32[src]

pub fn height(&self) -> f32[src]

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

Get the z height of a x/y point inside the navigation area

Examples

use sourcenav::get_quad_tree;

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

Trait Implementations

impl Debug for NavQuad[src]

Auto Trait Implementations

impl RefUnwindSafe for NavQuad

impl Send for NavQuad

impl Sync for NavQuad

impl Unpin for NavQuad

impl UnwindSafe for NavQuad

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.