[−][src]Trait nphysics2d::force_generator::ForceGenerator
A persistent force generator.
A force generator applies a force to one or several bodies at each step of the simulation.
Required methods
fn apply(&mut self, parameters: &IntegrationParameters<N>, bodies: &mut Bodies)
Apply forces to some bodies.
Methods
impl<N, Bodies> dyn ForceGenerator<N, Bodies> where
N: Any + 'static,
Bodies: Any + 'static,
N: RealField,
Bodies: BodySet<N>,
N: Any + 'static,
Bodies: Any + 'static,
N: RealField,
Bodies: BodySet<N>,
pub fn is<__T: ForceGenerator<N, Bodies>>(&self) -> bool
Returns true if the trait object wraps an object of type __T
.
pub fn downcast<__T: ForceGenerator<N, Bodies>>(
self: Box<Self>
) -> Result<Box<__T>, Box<Self>>
self: Box<Self>
) -> Result<Box<__T>, Box<Self>>
Returns a boxed object from a boxed trait object if the underlying object is of type
__T
. Returns the original boxed trait if it isn't.
pub fn downcast_ref<__T: ForceGenerator<N, Bodies>>(&self) -> Option<&__T>
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn't.
pub fn downcast_mut<__T: ForceGenerator<N, Bodies>>(
&mut self
) -> Option<&mut __T>
&mut self
) -> Option<&mut __T>
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn't.