Struct oxygengine_navigation::components::NavAgent [−][src]
pub struct NavAgent {
pub position: NavVec3,
pub direction: NavVec3,
pub speed: Scalar,
pub radius: Scalar,
pub min_target_distance: Scalar,
// some fields omitted
}Expand description
Nav agent component.
Fields
position: NavVec3Current agent position in world space.
direction: NavVec3Current agent normalized direction.
speed: ScalarCurrent speed (units per second).
radius: ScalarAgent sphere radius (used in obstacle and agent avoidance).
min_target_distance: ScalarMnimal distance to target (affects direction, tells how far look for point to go to in an instant).
Implementations
pub fn set_destination(
&mut self,
target: NavAgentTarget,
query: NavQuery,
mode: NavPathMode,
mesh: NavMeshID
)
pub fn set_destination(
&mut self,
target: NavAgentTarget,
query: NavQuery,
mode: NavPathMode,
mesh: NavMeshID
)
Sets destination to go to.
Arguments
target- target to go to.query- query quality.mode- path finding quality.mesh- nav mesh to move on.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
fn from_prefab_with_extras(
data: Value,
_named_entities: &HashMap<String, Entity, RandomState>,
_state_token: ID<PhantomData<dyn State + Send + Sync + 'static>>
) -> Result<Self, PrefabError>
Auto Trait Implementations
impl RefUnwindSafe for NavAgent
impl UnwindSafe for NavAgent
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self is actually part of its subset T (and can be converted to it).
pub unsafe fn to_subset_unchecked(&self) -> SS
pub unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self to the equivalent element of its superset.
