[−][src]Trait nphysics3d::force_generator::ForceGeneratorSet
Trait implemented by sets of force generators.
A set of bodies maps a force generator handle to a force generator instance.
Associated Types
type ForceGenerator: ?Sized + ForceGenerator<N, Handle>
[src]
Type of a force generator stored in this set.
type Handle: Copy
[src]
Type of a force generator handle identifying a force generator in this set.
Required methods
pub fn get(&self, handle: Self::Handle) -> Option<&Self::ForceGenerator>
[src]
Gets a reference to the force generator identified by handle
.
pub fn get_mut(
&mut self,
handle: Self::Handle
) -> Option<&mut Self::ForceGenerator>
[src]
&mut self,
handle: Self::Handle
) -> Option<&mut Self::ForceGenerator>
Gets a mutable reference to the force generator identified by handle
.
pub fn contains(&self, handle: Self::Handle) -> bool
[src]
Check if this set contains a force generator identified by handle
.
pub fn foreach(&self, f: impl FnMut(Self::Handle, &Self::ForceGenerator))
[src]
Iterate through all the force generators on this set, applying the closure f
on them.
pub fn foreach_mut(
&mut self,
f: impl FnMut(Self::Handle, &mut Self::ForceGenerator)
)
[src]
&mut self,
f: impl FnMut(Self::Handle, &mut Self::ForceGenerator)
)
Mutable iterates through all the force generators on this set, applying the closure f
on them.
Implementors
impl<N: RealField, Handle: BodyHandle> ForceGeneratorSet<N, Handle> for DefaultForceGeneratorSet<N, Handle>
[src]
type ForceGenerator = dyn ForceGenerator<N, Handle>
type Handle = DefaultForceGeneratorHandle
pub fn get(&self, handle: Self::Handle) -> Option<&Self::ForceGenerator>
[src]
pub fn get_mut(
&mut self,
handle: Self::Handle
) -> Option<&mut Self::ForceGenerator>
[src]
&mut self,
handle: Self::Handle
) -> Option<&mut Self::ForceGenerator>
pub fn contains(&self, handle: Self::Handle) -> bool
[src]
pub fn foreach(&self, f: impl FnMut(Self::Handle, &Self::ForceGenerator))
[src]
pub fn foreach_mut(
&mut self,
f: impl FnMut(Self::Handle, &mut Self::ForceGenerator)
)
[src]
&mut self,
f: impl FnMut(Self::Handle, &mut Self::ForceGenerator)
)