NavMeshObstacle

Struct NavMeshObstacle 

Source
pub struct NavMeshObstacle {
    pub m_Enabled: u8,
    pub m_GameObject: PPtr,
    pub m_Carve: Option<bool>,
    pub m_CarveOnlyStationary: Option<bool>,
    pub m_Center: Option<Vector3f>,
    pub m_Extents: Option<Vector3f>,
    pub m_Height: Option<f32>,
    pub m_MoveThreshold: Option<f32>,
    pub m_Radius: Option<f32>,
    pub m_Shape: Option<i32>,
    pub m_TimeToStationary: Option<f32>,
}
Expand description

NavMeshObstacle is a class of the Unity engine since version 4.0.0. Exert from Unity’s scripting documentation: An obstacle for NavMeshAgents to avoid. A NavMeshObstacle is cylindrical in shape and can move around the surface of the NavMesh with a specified velocity. By default, the obstacle will only affect the agent’s avoidance behaviour rather than the pathfinding. This means that the agent will ignore the obstacle when plotting a path but will sidestep around it while moving along the path. If carving is enabled, the obstacle will create a temporary “hole” in the NavMesh. The hole will be recognised by the pathfinding, so paths will be plotted to avoid the obstacle. This means that if, say, an obstacle blocks a narrow gap, the pathfinding will seek an alternative route to the target. Without carving, the agent will head for the gap but won’t be able to pass until the obstacle is clear.See Also: NavMeshAgent.

Fields§

§m_Enabled: u8

Enabled Behaviours are Updated, disabled Behaviours are not.

§m_GameObject: PPtr

The game object this component is attached to. A component is always attached to a game object. PPtr<GameObject>: (4.0.0 - 2022.3.2f1)

§m_Carve: Option<bool>

bool: (4.3.0 - 2022.3.2f1)

§m_CarveOnlyStationary: Option<bool>

Should this obstacle be carved when it is constantly moving? bool: (5.0.0f4 - 2022.3.2f1)

§m_Center: Option<Vector3f>

The center of the obstacle, measured in the object’s local space. Vector3f: (5.0.0f4 - 2022.3.2f1)

§m_Extents: Option<Vector3f>

Vector3f: (5.0.0f4 - 2022.3.2f1)

§m_Height: Option<f32>

Height of the obstacle’s cylinder shape. f32: (4.0.0 - 4.7.2)

§m_MoveThreshold: Option<f32>

f32: (4.3.0 - 2022.3.2f1)

§m_Radius: Option<f32>

Radius of the obstacle’s capsule shape. f32: (4.0.0 - 4.7.2)

§m_Shape: Option<i32>

The shape of the obstacle. i32: (5.0.0f4 - 2022.3.2f1)

§m_TimeToStationary: Option<f32>

f32: (5.0.0f4 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for NavMeshObstacle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NavMeshObstacle

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for NavMeshObstacle

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,