Struct nphysics3d::world::MechanicalWorld [−][src]
pub struct MechanicalWorld<N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle> { pub counters: Counters, pub solver: MoreauJeanSolver<N, Handle, CollHandle>, pub integration_parameters: IntegrationParameters<N>, pub material_coefficients: MaterialsCoefficientsTable<N>, pub gravity: Vector<N>, // some fields omitted }
Expand description
The physics world.
Fields
counters: Counters
Performance counters used for debugging and benchmarking nphysics.
solver: MoreauJeanSolver<N, Handle, CollHandle>
The constraints solver.
integration_parameters: IntegrationParameters<N>
Parameters of the whole simulation.
material_coefficients: MaterialsCoefficientsTable<N>
Coefficient table used for resolving material properties to apply at one contact.
gravity: Vector<N>
The acting on this mechanical world.
Implementations
impl<N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle> MechanicalWorld<N, Handle, CollHandle>
impl<N: RealField + Copy, Handle: BodyHandle, CollHandle: ColliderHandle> MechanicalWorld<N, Handle, CollHandle>
Creates a new physics world with default parameters.
The ground body is automatically created and added to the world without any colliders attached.
Sets the timestep used for the integration.
pub fn maintain<Colliders, Constraints>(
&mut self,
gworld: &mut GeometricalWorld<N, Handle, CollHandle>,
bodies: &mut dyn BodySet<N, Handle = Handle>,
colliders: &mut Colliders,
constraints: &mut Constraints
) where
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Constraints: JointConstraintSet<N, Handle>,
pub fn maintain<Colliders, Constraints>(
&mut self,
gworld: &mut GeometricalWorld<N, Handle, CollHandle>,
bodies: &mut dyn BodySet<N, Handle = Handle>,
colliders: &mut Colliders,
constraints: &mut Constraints
) where
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Constraints: JointConstraintSet<N, Handle>,
Maintain the internal structures of the mechanical world by handling insersion and removal events from every sets this mechanical world interacts with.
pub fn step<Bodies, Colliders, Constraints, Forces>(
&mut self,
gworld: &mut GeometricalWorld<N, Handle, CollHandle>,
bodies: &mut Bodies,
colliders: &mut Colliders,
constraints: &mut Constraints,
forces: &mut Forces
) where
Bodies: BodySet<N, Handle = Handle>,
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Constraints: JointConstraintSet<N, Handle>,
Forces: ForceGeneratorSet<N, Handle>,
pub fn step<Bodies, Colliders, Constraints, Forces>(
&mut self,
gworld: &mut GeometricalWorld<N, Handle, CollHandle>,
bodies: &mut Bodies,
colliders: &mut Colliders,
constraints: &mut Constraints,
forces: &mut Forces
) where
Bodies: BodySet<N, Handle = Handle>,
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Constraints: JointConstraintSet<N, Handle>,
Forces: ForceGeneratorSet<N, Handle>,
Execute one time step of the physics simulation.
pub fn step_with_filter<Bodies, Colliders, Constraints, Forces, Filter: ?Sized>(
&mut self,
gworld: &mut GeometricalWorld<N, Handle, CollHandle>,
bodies: &mut Bodies,
colliders: &mut Colliders,
constraints: &mut Constraints,
forces: &mut Forces,
filter: &Filter
) where
Bodies: BodySet<N, Handle = Handle>,
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Constraints: JointConstraintSet<N, Handle>,
Forces: ForceGeneratorSet<N, Handle>,
Filter: for<'a> BroadPhasePairFilter<N, BroadPhasePairFilterSets<'a, N, Bodies, Colliders>> + ?Sized,
pub fn step_with_filter<Bodies, Colliders, Constraints, Forces, Filter: ?Sized>(
&mut self,
gworld: &mut GeometricalWorld<N, Handle, CollHandle>,
bodies: &mut Bodies,
colliders: &mut Colliders,
constraints: &mut Constraints,
forces: &mut Forces,
filter: &Filter
) where
Bodies: BodySet<N, Handle = Handle>,
Colliders: ColliderSet<N, Handle, Handle = CollHandle>,
Constraints: JointConstraintSet<N, Handle>,
Forces: ForceGeneratorSet<N, Handle>,
Filter: for<'a> BroadPhasePairFilter<N, BroadPhasePairFilterSets<'a, N, Bodies, Colliders>> + ?Sized,
Execute one time step of the physics simulation.
Auto Trait Implementations
impl<N, Handle, CollHandle> !RefUnwindSafe for MechanicalWorld<N, Handle, CollHandle>
impl<N, Handle, CollHandle> Send for MechanicalWorld<N, Handle, CollHandle>
impl<N, Handle, CollHandle> Sync for MechanicalWorld<N, Handle, CollHandle>
impl<N, Handle, CollHandle> Unpin for MechanicalWorld<N, Handle, CollHandle> where
CollHandle: Unpin,
Handle: Unpin,
N: Unpin,
impl<N, Handle, CollHandle> !UnwindSafe for MechanicalWorld<N, Handle, CollHandle>
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.