[][src]Struct sourcenav::NavArea

pub struct NavArea {
    pub id: NavAreaId,
    pub north_west: Vector3,
    pub south_east: Vector3,
    pub north_east_z: f32,
    pub south_west_z: f32,
    pub flags: u32,
    pub connections: Connections,
    pub hiding_spots: Vec<NavHidingSpot>,
    pub approach_areas: Vec<ApproachArea>,
    pub encounter_paths: Vec<EncounterPath>,
    pub place: u16,
    pub light_intensity: LightIntensity,
    pub ladder_connections: LadderConnections,
    pub earliest_occupy_first_team: f32,
    pub earliest_occupy_second_team: f32,
    pub visible_areas: Vec<VisibleArea>,
    pub inherit_visibility_from_area_id: u32,
}

A navigation area from the nav file

Fields

id: NavAreaIdnorth_west: Vector3south_east: Vector3north_east_z: f32south_west_z: f32flags: u32connections: Connectionshiding_spots: Vec<NavHidingSpot>approach_areas: Vec<ApproachArea>encounter_paths: Vec<EncounterPath>place: u16light_intensity: LightIntensityladder_connections: LadderConnectionsearliest_occupy_first_team: f32earliest_occupy_second_team: f32visible_areas: Vec<VisibleArea>inherit_visibility_from_area_id: u32

Methods

impl NavArea[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_area_tree;

  let file = std::fs::read("path/to/navfile.nav")?;
  let tree = get_area_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 NavArea[src]

Auto Trait Implementations

impl RefUnwindSafe for NavArea

impl Send for NavArea

impl Sync for NavArea

impl Unpin for NavArea

impl UnwindSafe for NavArea

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.