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
) -> Retwhere
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
) -> Retwhere
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 as ArticulationBase>::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
)
sourcefn get_solver_iteration_counts(&self) -> (u32, u32)
fn get_solver_iteration_counts(&self) -> (u32, u32)
sourcefn is_sleeping(&self) -> bool
fn is_sleeping(&self) -> bool
sourcefn set_sleep_threshold(&mut self, threshold: f32)
fn set_sleep_threshold(&mut self, threshold: f32)
sourcefn get_sleep_threshold(&self) -> f32
fn get_sleep_threshold(&self) -> f32
sourcefn set_stabilization_threshold(&mut self, threshold: f32)
fn set_stabilization_threshold(&mut self, threshold: f32)
sourcefn get_stabilization_threshold(&self) -> f32
fn get_stabilization_threshold(&self) -> f32
sourcefn set_wake_counter(&mut self, threshold: f32)
fn set_wake_counter(&mut self, threshold: f32)
sourcefn get_wake_counter(&self) -> f32
fn get_wake_counter(&self) -> f32
sourcefn put_to_sleep(&mut self)
fn put_to_sleep(&mut self)
sourcefn get_nb_links(&self) -> usize
fn get_nb_links(&self) -> usize
sourcefn root_link(&self) -> Option<&Self::ArticulationLink>
fn root_link(&self) -> Option<&Self::ArticulationLink>
sourcefn root_link_mut(&mut self) -> Option<&mut Self::ArticulationLink>
fn root_link_mut(&mut self) -> Option<&mut Self::ArticulationLink>
sourcefn get_links(&self) -> Vec<&Self::ArticulationLink>
fn get_links(&self) -> Vec<&Self::ArticulationLink>
sourcefn get_links_mut(&mut self) -> Vec<&mut Self::ArticulationLink>
fn get_links_mut(&mut self) -> Vec<&mut Self::ArticulationLink>
sourcefn get_world_bounds(&self, inflation: f32) -> PxBounds3
fn get_world_bounds(&self, inflation: f32) -> PxBounds3
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>
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>
sourceunsafe fn release_articulation_joint(
&mut self,
joint: &mut impl ArticulationJointBase
)
unsafe fn release_articulation_joint(
&mut self,
joint: &mut impl ArticulationJointBase
)
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
sourcefn as_mut_ptr(&mut self) -> *mut S
fn as_mut_ptr(&mut self) -> *mut S
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 Twhere
T: Class<PxBase>,
impl<T> Base for Twhere
T: Class<PxBase>,
sourcefn get_concrete_type_name(&self) -> Option<&str>
fn get_concrete_type_name(&self) -> Option<&str>
sourcefn get_concrete_type(&self) -> ConcreteType
fn get_concrete_type(&self) -> ConcreteType
get_active_actors
. Use
get_type
for actors if possible. Read moresourcefn set_base_flag(&mut self, flag: BaseFlag, value: bool)
fn set_base_flag(&mut self, flag: BaseFlag, value: bool)
sourcefn set_base_flags(&mut self, in_flags: BitFlags<BaseFlag>)
fn set_base_flags(&mut self, in_flags: BitFlags<BaseFlag>)
set_base_flag
to set individual flags. Read more