[][src]Struct hassium_navigation::component::NavAgent

pub struct NavAgent {
    pub position: NavVec3,
    pub direction: NavVec3,
    pub speed: Scalar,
    pub radius: Scalar,
    pub min_target_distance: Scalar,
    // some fields omitted
}

Nav agent component.

Fields

position: NavVec3

Current agent position in world space.

direction: NavVec3

Current agent normalized direction.

speed: Scalar

Current speed (units per second).

radius: Scalar

Agent sphere radius (used in obstacle and agent avoidance).

min_target_distance: Scalar

Mnimal distance to target (affects direction, tells how far look for point to go to in an instant).

Methods

impl NavAgent[src]

pub fn new(position: NavVec3) -> Self[src]

pub fn new_with_direction(position: NavVec3, direction: NavVec3) -> Self[src]

pub fn id(&self) -> NavAgentID[src]

pub fn target(&self) -> Option<NavAgentTarget>[src]

pub fn destination(&self) -> Option<&NavAgentDestination>[src]

pub fn set_destination(
    &mut self,
    target: NavAgentTarget,
    query: NavQuery,
    mode: NavPathMode,
    mesh: NavMeshID
)
[src]

Sets destination to go to.

Arguments

  • target - target to go to.
  • query - query quality.
  • mode - path finding quality.
  • mesh - nav mesh to move on.

pub fn clear_path(&mut self)[src]

pub fn recalculate_path(&mut self)[src]

pub fn path(&self) -> Option<&[NavVec3]>[src]

pub fn set_path(&mut self, path: Vec<NavVec3>)[src]

Trait Implementations

impl Default for NavAgent[src]

impl Clone for NavAgent[src]

impl Debug for NavAgent[src]

impl Component for NavAgent[src]

type Storage = VecStorage<Self>

Associated storage type for this component.

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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.

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

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

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

impl<T> TryDefault for T where
    T: Default

impl<T> Any for T where
    T: Any

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> Erased for T

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,