Struct physx::articulation_base::ArticulationMap
source · [−]#[repr(transparent)]pub struct ArticulationMap<T, C> where
T: Articulation,
C: ArticulationReducedCoordinate, { /* private fields */ }
Expand description
A wrapper for ArticulationBase, parametrized by the Articulation and
ArticulationReducedCoordinate that may be it’s most derived type. Use try_cast_map
or as_*
to cast to it’s most derived type if specialized functionality is needed.
Implementations
sourceimpl<T, C> ArticulationMap<T, C> where
T: Articulation,
C: ArticulationReducedCoordinate,
impl<T, C> ArticulationMap<T, C> where
T: Articulation,
C: ArticulationReducedCoordinate,
sourcepub unsafe fn cast_map<'a, Ret, ArtFn, ArcFn>(
&'a mut self,
art_fn: ArtFn,
arc_fn: ArcFn
) -> Ret where
ArtFn: FnMut(&'a mut T) -> Ret,
ArcFn: FnMut(&'a mut C) -> Ret,
pub unsafe fn cast_map<'a, Ret, ArtFn, ArcFn>(
&'a mut self,
art_fn: ArtFn,
arc_fn: ArcFn
) -> Ret where
ArtFn: FnMut(&'a mut T) -> Ret,
ArcFn: FnMut(&'a mut C) -> Ret,
Safety
this relies on get_concrete_type
to determine the articulation type,
which has had issues with returning ConcreteType::Undefined for Actor subclasses.
try_cast_map
will return None
when this would crash.
sourcepub fn try_cast_map<'a, Ret, ArtFn, ArcFn>(
&'a mut self,
art_fn: ArtFn,
arc_fn: ArcFn
) -> Option<Ret> where
ArtFn: FnMut(&'a mut T) -> Ret,
ArcFn: FnMut(&'a mut C) -> Ret,
pub fn try_cast_map<'a, Ret, ArtFn, ArcFn>(
&'a mut self,
art_fn: ArtFn,
arc_fn: ArcFn
) -> Option<Ret> where
ArtFn: FnMut(&'a mut T) -> Ret,
ArcFn: FnMut(&'a mut C) -> Ret,
Calls one of the given functions and returns the result if the articulation can be
safely cast to that type. If get_concrete_type
does not return ConcreteType::Articulation
or ConcreteType::ArticulationReducedCoordinate
this call returns None
.
sourcepub fn as_articulation(&mut self) -> Option<&mut T>
pub fn as_articulation(&mut self) -> Option<&mut T>
Tries to cast to PxArticulation, returns None
if get_concrete_type
does not
return ConcreteType::Articulation.
sourcepub fn as_articulation_reduced_coordinate(&mut self) -> Option<&mut T>
pub fn as_articulation_reduced_coordinate(&mut self) -> Option<&mut T>
Tries to cast to PxArticulationReducedCoordinate, returns None
if get_concrete_type
does not return ConcreteType::ArticulationReducedCoordinate.
Trait Implementations
sourceimpl<T, C> ArticulationBase for ArticulationMap<T, C> where
T: Articulation,
C: ArticulationReducedCoordinate,
impl<T, C> ArticulationBase for ArticulationMap<T, C> where
T: Articulation,
C: ArticulationReducedCoordinate,
type ArticulationLink = T::ArticulationLink
sourcefn set_solver_iteration_counts(
&mut self,
min_position_iters: u32,
min_velocity_iters: u32
)
fn set_solver_iteration_counts(
&mut self,
min_position_iters: u32,
min_velocity_iters: u32
)
Sets the number of iterations the solver should perform. If the articulation is behaving erratically, increasing the iteration counts may improve stability. Read more
sourcefn get_solver_iteration_counts(&self) -> (u32, u32)
fn get_solver_iteration_counts(&self) -> (u32, u32)
Get the number of (position, velocity) iterations the solver will perform.
sourcefn is_sleeping(&self) -> bool
fn is_sleeping(&self) -> bool
Check if the articulation is sleeping
sourcefn set_sleep_threshold(&mut self, threshold: f32)
fn set_sleep_threshold(&mut self, threshold: f32)
Set the inactivity threshold for sleeping this articulation
sourcefn get_sleep_threshold(&self) -> f32
fn get_sleep_threshold(&self) -> f32
Read back the inactivity threshold
sourcefn set_stabilization_threshold(&mut self, threshold: f32)
fn set_stabilization_threshold(&mut self, threshold: f32)
Set the stabilization threshold for this articulation
sourcefn get_stabilization_threshold(&self) -> f32
fn get_stabilization_threshold(&self) -> f32
Get the stabilization threshold for this articulation
sourcefn set_wake_counter(&mut self, threshold: f32)
fn set_wake_counter(&mut self, threshold: f32)
Set the counter for how many steps more the articulation will be awake if below the energy threshold. When this is non-zero, the articulation may sleep but is not required to do so depending on other factors. Read more
sourcefn get_wake_counter(&self) -> f32
fn get_wake_counter(&self) -> f32
Get the counter for how many steps more the agent will be awake if below the energy threshold.
sourcefn put_to_sleep(&mut self)
fn put_to_sleep(&mut self)
Put the articulation to sleep immediately
sourcefn get_nb_links(&self) -> usize
fn get_nb_links(&self) -> usize
Get the total number of links on this articulation
sourcefn root_link(&self) -> Option<&Self::ArticulationLink>
fn root_link(&self) -> Option<&Self::ArticulationLink>
Get a reference the root link of this articulation if it has one
sourcefn root_link_mut(&mut self) -> Option<&mut Self::ArticulationLink>
fn root_link_mut(&mut self) -> Option<&mut Self::ArticulationLink>
Get a mutable reference to the root link of this articulation if it has one
sourcefn get_links(&self) -> Vec<&Self::ArticulationLink>
fn get_links(&self) -> Vec<&Self::ArticulationLink>
Get a vec of all the links
sourcefn get_links_mut(&mut self) -> Vec<&mut Self::ArticulationLink>
fn get_links_mut(&mut self) -> Vec<&mut Self::ArticulationLink>
Get a mutable vec of all the links
sourcefn get_world_bounds(&self, inflation: f32) -> PxBounds3
fn get_world_bounds(&self, inflation: f32) -> PxBounds3
Get the world bounds of this articulation
sourcefn create_link(
&mut self,
parent: Option<&mut Self::ArticulationLink>,
pose: &PxTransform,
user_data: <Self::ArticulationLink as UserData>::UserData
) -> Option<&mut Self::ArticulationLink>
fn create_link(
&mut self,
parent: Option<&mut Self::ArticulationLink>,
pose: &PxTransform,
user_data: <Self::ArticulationLink as UserData>::UserData
) -> Option<&mut Self::ArticulationLink>
Add a link to this articulation
sourcefn create_articulation_joint<J: ArticulationJointBase>(
&mut self,
parent: &mut Self::ArticulationLink,
parent_frame: &PxTransform,
child: &mut Self::ArticulationLink,
child_frame: &PxTransform
) -> Option<&mut J>
fn create_articulation_joint<J: ArticulationJointBase>(
&mut self,
parent: &mut Self::ArticulationLink,
parent_frame: &PxTransform,
child: &mut Self::ArticulationLink,
child_frame: &PxTransform
) -> Option<&mut J>
Create a joint between two articulation Links
sourceunsafe fn release_articulation_joint(
&mut self,
joint: &mut impl ArticulationJointBase
)
unsafe fn release_articulation_joint(
&mut self,
joint: &mut impl ArticulationJointBase
)
Release an articulation joint, freeing it. Read more
sourceimpl<S, T, C> Class<S> for ArticulationMap<T, C> where
PxArticulationBase: Class<S>,
T: Articulation,
C: ArticulationReducedCoordinate,
impl<S, T, C> Class<S> for ArticulationMap<T, C> where
PxArticulationBase: Class<S>,
T: Articulation,
C: ArticulationReducedCoordinate,
sourcefn as_ptr(&self) -> *const S
fn as_ptr(&self) -> *const S
Returns a raw const pointer to the wrapped type. Retrieving a raw pointer is safe. However, pretty much any use of a raw pointer is unsafe. In particular: this pointer should not be used to construct a second owning wrapper around the pointer. Read more
sourcefn as_mut_ptr(&mut self) -> *mut S
fn as_mut_ptr(&mut self) -> *mut S
Returns a raw mut pointer to the wrapped type. Retrieving a raw pointer is safe. However, pretty much any use of a raw pointer is unsafe. In particular: this pointer should not be used to construct a second owning wrapper around the pointer. Read more
Auto Trait Implementations
impl<T, C> RefUnwindSafe for ArticulationMap<T, C> where
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, C> !Send for ArticulationMap<T, C>
impl<T, C> !Sync for ArticulationMap<T, C>
impl<T, C> Unpin for ArticulationMap<T, C>
impl<T, C> UnwindSafe for ArticulationMap<T, C> where
C: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> Base for T where
T: Class<PxBase>,
impl<T> Base for T where
T: Class<PxBase>,
sourcefn get_concrete_type_name(&self) -> Option<&str>
fn get_concrete_type_name(&self) -> Option<&str>
Get the name of the real type referenced by this pointer, or None if the returned string is not valid
sourcefn get_concrete_type(&self) -> ConcreteType
fn get_concrete_type(&self) -> ConcreteType
Returns an enumerated value identifying the type. This may return ConcreteType::Undefined
in surprising situations, notably this does not seem to work with get_active_actors
. Use
get_type
for actors if possible. Read more
sourcefn set_base_flag(&mut self, flag: BaseFlag, value: bool)
fn set_base_flag(&mut self, flag: BaseFlag, value: bool)
Set or unset the specified flag on this object.
sourcefn set_base_flags(&mut self, in_flags: BitFlags<BaseFlag>)
fn set_base_flags(&mut self, in_flags: BitFlags<BaseFlag>)
Set the BaseFlags of this object. Note that replaces all flags currently
on the object. Use set_base_flag
to set individual flags. Read more
sourcefn get_base_flags(&self) -> BitFlags<BaseFlag>
fn get_base_flags(&self) -> BitFlags<BaseFlag>
Read the BaseFlags of this object
sourcefn is_releasable(&self) -> bool
fn is_releasable(&self) -> bool
Returns true if this object can be released, i.e., it is not subordinate.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more