pub struct Ground<N>{ /* private fields */ }Expand description
A singleton representing the ground.
Most of its methods are useless but provided anyway to be similar to the other bodies.
Implementations§
Trait Implementations§
Source§impl<N> Body<N> for Ground<N>
impl<N> Body<N> for Ground<N>
Source§fn gravity_enabled(&self) -> bool
fn gravity_enabled(&self) -> bool
Whether this body is affected by gravity.
Source§fn enable_gravity(&mut self, _: bool)
fn enable_gravity(&mut self, _: bool)
Enable or disable gravity for this body.
fn step_started(&mut self)
Source§fn update_kinematics(&mut self)
fn update_kinematics(&mut self)
Updates the kinematics, e.g., positions and jacobians, of this body.
Source§fn update_dynamics(&mut self, _: N)
fn update_dynamics(&mut self, _: N)
Update the dynamics property of this body.
Source§fn update_acceleration(
&mut self,
_: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
_: &IntegrationParameters<N>,
)
fn update_acceleration( &mut self, _: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, _: &IntegrationParameters<N>, )
Update the acceleration of this body given the forces it is subject to and the gravity.
Source§fn clear_forces(&mut self)
fn clear_forces(&mut self)
Reset the timestep-specific dynamic information of this body.
Source§fn clear_update_flags(&mut self)
fn clear_update_flags(&mut self)
Clear all the update flags of this body.
Source§fn update_status(&self) -> BodyUpdateStatus
fn update_status(&self) -> BodyUpdateStatus
The flags tracking what modifications were applied to a body.
Source§fn part(&self, i: usize) -> Option<&(dyn BodyPart<N> + 'static)>
fn part(&self, i: usize) -> Option<&(dyn BodyPart<N> + 'static)>
A reference to the specified body part.
Source§fn apply_displacement(&mut self, _: &[N])
fn apply_displacement(&mut self, _: &[N])
Applies a generalized displacement to this body.
Source§fn status(&self) -> BodyStatus
fn status(&self) -> BodyStatus
The status of this body.
Source§fn set_status(&mut self, _: BodyStatus)
fn set_status(&mut self, _: BodyStatus)
Set the status of this body.
Source§fn activation_status(&self) -> &ActivationStatus<N>
fn activation_status(&self) -> &ActivationStatus<N>
Information regarding activation and deactivation (sleeping) of this body.
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Whether or not the status of this body is dynamic.
Source§fn is_kinematic(&self) -> bool
fn is_kinematic(&self) -> bool
Whether or not the status of this body is kinematic.
Source§fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
If this is a deformable body, returns its deformed positions.
Source§fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
If this is a deformable body, returns a mutable reference to its deformed positions.
Source§fn generalized_acceleration(
&self,
) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_acceleration( &self, ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
The generalized accelerations at each degree of freedom of this body.
Source§fn generalized_velocity(
&self,
) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_velocity( &self, ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
The generalized velocities of this body.
Source§fn companion_id(&self) -> usize
fn companion_id(&self) -> usize
The companion ID of this body.
Source§fn set_companion_id(&mut self, id: usize)
fn set_companion_id(&mut self, id: usize)
Set the companion ID of this body (may be reinitialized by nphysics).
Source§fn generalized_velocity_mut(
&mut self,
) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_velocity_mut( &mut self, ) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
The mutable generalized velocities of this body.
Source§fn velocity_at_point(&self, _: usize, _: &OPoint<N, Const<2>>) -> Velocity2<N>
fn velocity_at_point(&self, _: usize, _: &OPoint<N, Const<2>>) -> Velocity2<N>
Gets the velocity of the given point of this body.
Source§fn integrate(&mut self, _: &IntegrationParameters<N>)
fn integrate(&mut self, _: &IntegrationParameters<N>)
Integrate the position of this body.
Source§fn activate_with_energy(&mut self, _: N)
fn activate_with_energy(&mut self, _: N)
Force the activation of this body with the given level of energy.
Source§fn deactivate(&mut self)
fn deactivate(&mut self)
Put this body to sleep.
Source§fn set_deactivation_threshold(&mut self, _: Option<N>)
fn set_deactivation_threshold(&mut self, _: Option<N>)
Sets the energy bellow which this body is put to sleep. Read more
Source§fn world_point_at_material_point(
&self,
_: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>,
) -> OPoint<N, Const<2>>
fn world_point_at_material_point( &self, _: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>>, ) -> OPoint<N, Const<2>>
Transform the given point expressed in material coordinates to world-space.
Source§fn position_at_material_point(
&self,
_: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>,
) -> Isometry<N, Unit<Complex<N>>, 2>
fn position_at_material_point( &self, _: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>>, ) -> Isometry<N, Unit<Complex<N>>, 2>
Transform the given point expressed in material coordinates to world-space.
Source§fn material_point_at_world_point(
&self,
_: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>,
) -> OPoint<N, Const<2>>
fn material_point_at_world_point( &self, _: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>>, ) -> OPoint<N, Const<2>>
Transform the given point expressed in material coordinates to world-space.
Source§fn fill_constraint_geometry(
&self,
_: &(dyn BodyPart<N> + 'static),
_: usize,
_: &OPoint<N, Const<2>>,
_: &ForceDirection<N>,
_: usize,
_: usize,
_: &mut [N],
_: &mut N,
_: Option<&Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>>,
_: Option<&mut N>,
)
fn fill_constraint_geometry( &self, _: &(dyn BodyPart<N> + 'static), _: usize, _: &OPoint<N, Const<2>>, _: &ForceDirection<N>, _: usize, _: usize, _: &mut [N], _: &mut N, _: Option<&Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>>, _: Option<&mut N>, )
Fills all the jacobians (and the jacobians multiplied by the inverse augmented mass matrix) for a
constraint applying a force at the point
center (relative to the body part’s center of mass) and
the direction dir. Read morefn advance(&mut self, _: N)
fn validate_advancement(&mut self)
fn clamp_advancement(&mut self)
fn part_motion(&self, _: usize, _: N) -> Option<BodyPartMotion<N>>
Source§fn has_active_internal_constraints(&mut self) -> bool
fn has_active_internal_constraints(&mut self) -> bool
Returns
true if this bodies contains internal constraints that need to be solved.Source§fn setup_internal_velocity_constraints(
&mut self,
_: &Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
_: &IntegrationParameters<N>,
)
fn setup_internal_velocity_constraints( &mut self, _: &Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, _: &IntegrationParameters<N>, )
Initializes the internal velocity constraints of a body.
Source§fn warmstart_internal_velocity_constraints(
&mut self,
_: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
)
fn warmstart_internal_velocity_constraints( &mut self, _: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, )
For warmstarting the solver, modifies the delta velocity applied by the internal constraints of this body.
Source§fn step_solve_internal_velocity_constraints(
&mut self,
_: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
)
fn step_solve_internal_velocity_constraints( &mut self, _: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, )
Execute one step for the iterative resolution of this body’s internal velocity constraints.
Source§fn step_solve_internal_position_constraints(
&mut self,
_: &IntegrationParameters<N>,
)
fn step_solve_internal_position_constraints( &mut self, _: &IntegrationParameters<N>, )
Execute one step for the iterative resolution of this body’s internal position constraints.
Source§fn apply_force(&mut self, _: usize, _: &Force2<N>, _: ForceType, _: bool)
fn apply_force(&mut self, _: usize, _: &Force2<N>, _: ForceType, _: bool)
Apply a force at the center of mass of a part of this body.
Source§fn apply_local_force(&mut self, _: usize, _: &Force2<N>, _: ForceType, _: bool)
fn apply_local_force(&mut self, _: usize, _: &Force2<N>, _: ForceType, _: bool)
Apply a local force at the center of mass of a part of this body.
Source§fn apply_force_at_point(
&mut self,
_: usize,
_: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
_: &OPoint<N, Const<2>>,
_: ForceType,
_: bool,
)
fn apply_force_at_point( &mut self, _: usize, _: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, _: &OPoint<N, Const<2>>, _: ForceType, _: bool, )
Apply a force at a given point of a part of this body.
Source§fn apply_local_force_at_point(
&mut self,
_: usize,
_: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
_: &OPoint<N, Const<2>>,
_: ForceType,
_: bool,
)
fn apply_local_force_at_point( &mut self, _: usize, _: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, _: &OPoint<N, Const<2>>, _: ForceType, _: bool, )
Apply a local force at a given point of a part of this body.
Source§fn apply_force_at_local_point(
&mut self,
_: usize,
_: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
_: &OPoint<N, Const<2>>,
_: ForceType,
_: bool,
)
fn apply_force_at_local_point( &mut self, _: usize, _: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, _: &OPoint<N, Const<2>>, _: ForceType, _: bool, )
Apply a force at a given local point of a part of this body.
Source§fn apply_local_force_at_local_point(
&mut self,
_: usize,
_: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
_: &OPoint<N, Const<2>>,
_: ForceType,
_: bool,
)
fn apply_local_force_at_local_point( &mut self, _: usize, _: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, _: &OPoint<N, Const<2>>, _: ForceType, _: bool, )
Apply a local force at a given local point of a part of this body.
Source§fn update_activation_status(&mut self)
fn update_activation_status(&mut self)
Update whether this body needs to be waken up after a user-interaction.
Source§fn add_local_inertia_and_com(
&mut self,
_part_index: usize,
_com: OPoint<N, Const<2>>,
_inertia: Inertia2<N>,
)
fn add_local_inertia_and_com( &mut self, _part_index: usize, _com: OPoint<N, Const<2>>, _inertia: Inertia2<N>, )
Add the given inertia to the local inertia of this body part.
Source§fn status_dependent_ndofs(&self) -> usize
fn status_dependent_ndofs(&self) -> usize
The number of degrees of freedom (DOF) of this body, taking its status into account. Read more
Source§impl<N> BodyPart<N> for Ground<N>
impl<N> BodyPart<N> for Ground<N>
Source§fn center_of_mass(&self) -> OPoint<N, Const<2>>
fn center_of_mass(&self) -> OPoint<N, Const<2>>
The center of mass of this body part.
Source§fn local_center_of_mass(&self) -> OPoint<N, Const<2>>
fn local_center_of_mass(&self) -> OPoint<N, Const<2>>
The local center of mass of this body part.
Source§fn position(&self) -> Isometry<N, Unit<Complex<N>>, 2>
fn position(&self) -> Isometry<N, Unit<Complex<N>>, 2>
The position of this body part wrt. the ground.
Source§fn safe_position(&self) -> Isometry<N, Unit<Complex<N>>, 2>
fn safe_position(&self) -> Isometry<N, Unit<Complex<N>>, 2>
If CCD is enabled, this is the last position known to be tunnelling-free.
Source§fn local_inertia(&self) -> Inertia2<N>
fn local_inertia(&self) -> Inertia2<N>
The local-space inertia of this body part.
Auto Trait Implementations§
impl<N> Freeze for Ground<N>where
N: Freeze,
impl<N> RefUnwindSafe for Ground<N>where
N: RefUnwindSafe,
impl<N> Send for Ground<N>
impl<N> Sync for Ground<N>
impl<N> Unpin for Ground<N>where
N: Unpin,
impl<N> UnsafeUnpin for Ground<N>where
N: UnsafeUnpin,
impl<N> UnwindSafe for Ground<N>where
N: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.