Skip to main content

Ground

Struct Ground 

Source
pub struct Ground<N>
where N: RealField + Copy,
{ /* 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§

Source§

impl<N> Ground<N>
where N: RealField + Copy,

Source

pub fn new() -> Ground<N>

Build a new ground structrure.

Trait Implementations§

Source§

impl<N> Body<N> for Ground<N>
where N: RealField + Copy,

Source§

fn gravity_enabled(&self) -> bool

Whether this body is affected by gravity.
Source§

fn enable_gravity(&mut self, _: bool)

Enable or disable gravity for this body.
Source§

fn step_started(&mut self)

Source§

fn update_kinematics(&mut self)

Updates the kinematics, e.g., positions and jacobians, of this body.
Source§

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>, )

Update the acceleration of this body given the forces it is subject to and the gravity.
Source§

fn clear_forces(&mut self)

Reset the timestep-specific dynamic information of this body.
Source§

fn clear_update_flags(&mut self)

Clear all the update flags of this body.
Source§

fn update_status(&self) -> BodyUpdateStatus

The flags tracking what modifications were applied to a body.
Source§

fn num_parts(&self) -> usize

The number of parts of this body.
Source§

fn part(&self, i: usize) -> Option<&(dyn BodyPart<N> + 'static)>

A reference to the specified body part.
Source§

fn is_ground(&self) -> bool

Returns true if this body is the ground.
Source§

fn apply_displacement(&mut self, _: &[N])

Applies a generalized displacement to this body.
Source§

fn status(&self) -> BodyStatus

The status of this body.
Source§

fn set_status(&mut self, _: BodyStatus)

Set the status of this body.
Source§

fn activation_status(&self) -> &ActivationStatus<N>

Information regarding activation and deactivation (sleeping) of this body.
Source§

fn is_active(&self) -> bool

Check if this body is active.
Source§

fn is_dynamic(&self) -> bool

Whether or not the status of this body is dynamic.
Source§

fn is_kinematic(&self) -> bool

Whether or not the status of this body is kinematic.
Source§

fn is_static(&self) -> bool

Whether or not the status of this body is static.
Source§

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])>

If this is a deformable body, returns a mutable reference to its deformed positions.
Source§

fn ndofs(&self) -> usize

The number of degrees of freedom of this body.
Source§

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>>

The generalized velocities of this body.
Source§

fn companion_id(&self) -> usize

The companion ID of this body.
Source§

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>>

The mutable generalized velocities of this body.
Source§

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>)

Integrate the position of this body.
Source§

fn activate(&mut self)

Force the activation of this body.
Source§

fn activate_with_energy(&mut self, _: N)

Force the activation of this body with the given level of energy.
Source§

fn deactivate(&mut self)

Put this body to sleep.
Source§

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>>

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>

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>>

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>, )

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 more
Source§

fn advance(&mut self, _: N)

Source§

fn validate_advancement(&mut self)

Source§

fn clamp_advancement(&mut self)

Source§

fn part_motion(&self, _: usize, _: N) -> Option<BodyPartMotion<N>>

Source§

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>, )

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>>, )

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>>, )

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>, )

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)

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)

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, )

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, )

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, )

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, )

Apply a local force at a given local point of a part of this body.
Source§

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>, )

Add the given inertia to the local inertia of this body part.
Source§

fn status_dependent_ndofs(&self) -> usize

The number of degrees of freedom (DOF) of this body, taking its status into account. Read more
Source§

fn status_dependent_body_part_velocity( &self, part: &(dyn BodyPart<N> + 'static), ) -> Velocity2<N>

The velocity of the specified body part, taking this body status into account. Read more
Source§

impl<N> BodyPart<N> for Ground<N>
where N: RealField + Copy,

Source§

fn is_ground(&self) -> bool

Returns true if this body part is the ground.
Source§

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>>

The local center of mass of this body part.
Source§

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>

If CCD is enabled, this is the last position known to be tunnelling-free.
Source§

fn velocity(&self) -> Velocity2<N>

The velocity of this body part.
Source§

fn inertia(&self) -> Inertia2<N>

The world-space inertia of this body part.
Source§

fn local_inertia(&self) -> Inertia2<N>

The local-space inertia of this body part.
Source§

impl<N> Clone for Ground<N>
where N: Clone + RealField + Copy,

Source§

fn clone(&self) -> Ground<N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N> Debug for Ground<N>
where N: Debug + RealField + Copy,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> Finalize for T

Source§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UserData for T
where T: Clone + Any + Send + Sync,

Source§

fn clone_boxed(&self) -> Box<dyn UserData>

Clone this trait-object.
Source§

fn to_any(&self) -> Box<dyn Any + Send + Sync>

Clone as its super-trait trait objects.
Source§

fn as_any(&self) -> &(dyn Any + Send + Sync + 'static)

Downcast to Any.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Component for T
where T: Send + Sync + 'static,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,