Struct oxygengine_physics_2d::prelude::Multibody [−][src]
Expand description
An articulated body simulated using the reduced-coordinates approach.
Implementations
Retrieves a reference to the user-defined user-data attached to this object.
Retrieves a mutable reference to the user-defined user-data attached to this object.
Sets the user-defined data attached to this object.
Replace by None
the user-defined data attached to this object and returns the old value.
The first link of this multibody.
Mutable reference to the first link of this multibody.
Reference i
-th multibody link of this multibody.
Return None
if there is less than i + 1
multibody links.
Mutable reference to the multibody link with the given id.
Return None
if the given id does not identifies a multibody link part of self
.
pub fn links_with_name(
&'a self,
name: &'a str
) -> impl Iterator<Item = (usize, &'a MultibodyLink<N>)>
pub fn links_with_name(
&'a self,
name: &'a str
) -> impl Iterator<Item = (usize, &'a MultibodyLink<N>)>
The links of this multibody with the given name
.
Iterator through all the links of this multibody.
All link are guaranteed to be yielded before its descendant.
Mutable iterator through all the links of this multibody.
All link are guaranteed to be yielded before its descendant.
The vector of damping applied to this multibody.
pub fn damping_mut(
&mut self
) -> &mut Matrix<N, Dynamic, Const<1_usize>, VecStorage<N, Dynamic, Const<1_usize>>>
pub fn damping_mut(
&mut self
) -> &mut Matrix<N, Dynamic, Const<1_usize>, VecStorage<N, Dynamic, Const<1_usize>>>
Mutable vector of damping applied to this multibody.
Set the mass of the specified link.
Set the angular inertia of the specified linked, expressed in its local space.
pub fn joint_velocity(
&self,
link: &MultibodyLink<N>
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
pub fn joint_velocity(
&self,
link: &MultibodyLink<N>
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
The generalized velocity at the joint of the given link.
pub fn link_jacobian_mul_force(
&self,
link: &MultibodyLink<N>,
force: &Force2<N>,
out: &mut [N]
)
pub fn link_jacobian_mul_force(
&self,
link: &MultibodyLink<N>,
force: &Force2<N>,
out: &mut [N]
)
Convert a force applied to the center of mass of the link rb_id
into generalized force.
pub fn inv_mass_mul_link_force(
&self,
link: &MultibodyLink<N>,
force: &Force2<N>,
out: &mut [N]
)
pub fn inv_mass_mul_link_force(
&self,
link: &MultibodyLink<N>,
force: &Force2<N>,
out: &mut [N]
)
Convert a force applied to this multibody’s link rb_id
center of mass into generalized accelerations.
pub fn inv_mass_mul_unit_joint_force(
&self,
link: &MultibodyLink<N>,
dof_id: usize,
force: N,
out: &mut [N]
)
pub fn inv_mass_mul_unit_joint_force(
&self,
link: &MultibodyLink<N>,
dof_id: usize,
force: N,
out: &mut [N]
)
Convert a generalized force applied to le link rb_id
’s degrees of freedom into generalized accelerations.
The joint attaching this link to its parent is assumed to be a unit joint.
pub fn inv_mass_mul_joint_force(
&self,
link: &MultibodyLink<N>,
force: Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>,
out: &mut [N]
)
pub fn inv_mass_mul_joint_force(
&self,
link: &MultibodyLink<N>,
force: Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>,
out: &mut [N]
)
Convert a generalized force applied to the link rb_id
’s degrees of freedom into generalized accelerations.
The augmented mass (inluding gyroscropic and coriolis terms) in world-space of this multibody.
Retrieve the mutable generalized velocities of this link.
pub fn generalized_force(
&self
) -> &Matrix<N, Dynamic, Const<1_usize>, VecStorage<N, Dynamic, Const<1_usize>>>
pub fn generalized_force(
&self
) -> &Matrix<N, Dynamic, Const<1_usize>, VecStorage<N, Dynamic, Const<1_usize>>>
The generalized forces applied to this multibody at the next timestep.
pub fn generalized_force_mut(
&mut self
) -> &mut Matrix<N, Dynamic, Const<1_usize>, VecStorage<N, Dynamic, Const<1_usize>>>
pub fn generalized_force_mut(
&mut self
) -> &mut Matrix<N, Dynamic, Const<1_usize>, VecStorage<N, Dynamic, Const<1_usize>>>
Mutable reference to the generalized forces applied to this multibody at the next timestep.
Trait Implementations
A reference to the specified body part.
If this is a deformable body, returns its deformed positions.
If this is a deformable body, returns a mutable reference to its deformed positions.
Clear all the update flags of this body.
The flags tracking what modifications were applied to a body.
Integrate the position of this body.
Applies a generalized displacement to this body.
Reset the timestep-specific dynamic information of this body.
Updates the kinematics, e.g., positions and jacobians, of this body.
Update the dynamics property of this body.
pub fn update_acceleration(
&mut self,
gravity: &Matrix<N, Const<{_: usize}>, Const<1_usize>, ArrayStorage<N, 2_usize, 1_usize>>,
&IntegrationParameters<N>
)
pub fn update_acceleration(
&mut self,
gravity: &Matrix<N, Const<{_: usize}>, Const<1_usize>, ArrayStorage<N, 2_usize, 1_usize>>,
&IntegrationParameters<N>
)
Update the acceleration of this body given the forces it is subject to and the gravity.
pub fn generalized_acceleration(
&self
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
pub fn generalized_acceleration(
&self
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
The generalized accelerations at each degree of freedom of this body.
pub fn generalized_velocity(
&self
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
pub fn generalized_velocity(
&self
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
The generalized velocities of this body.
pub fn generalized_velocity_mut(
&mut self
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorageMut<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
pub fn generalized_velocity_mut(
&mut self
) -> Matrix<N, Dynamic, Const<1_usize>, SliceStorageMut<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
The mutable generalized velocities of this body.
Whether this body is affected by gravity.
Enable or disable gravity for this body.
Information regarding activation and deactivation (sleeping) of this body.
Force the activation of this body with the given level of energy.
Put this body to sleep.
Sets the energy bellow which this body is put to sleep. Read more
Set the status of this body.
The status of this body.
The companion ID of this body.
Set the companion ID of this body (may be reinitialized by nphysics).
Transform the given point expressed in material coordinates to world-space.
Transform the given point expressed in material coordinates to world-space.
Transform the given point expressed in material coordinates to world-space.
pub fn fill_constraint_geometry(
&self,
part: &(dyn BodyPart<N> + 'static),
ndofs: usize,
point: &OPoint<N, Const<2_usize>>,
force_dir: &ForceDirection<N>,
j_id: usize,
wj_id: usize,
jacobians: &mut [N],
inv_r: &mut N,
ext_vels: Option<&Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>>,
out_vel: Option<&mut N>
)
pub fn fill_constraint_geometry(
&self,
part: &(dyn BodyPart<N> + 'static),
ndofs: usize,
point: &OPoint<N, Const<2_usize>>,
force_dir: &ForceDirection<N>,
j_id: usize,
wj_id: usize,
jacobians: &mut [N],
inv_r: &mut N,
ext_vels: Option<&Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>>,
out_vel: 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
Returns true
if this bodies contains internal constraints that need to be solved.
pub fn setup_internal_velocity_constraints(
&mut self,
ext_vels: &Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>,
parameters: &IntegrationParameters<N>
)
pub fn setup_internal_velocity_constraints(
&mut self,
ext_vels: &Matrix<N, Dynamic, Const<1_usize>, SliceStorage<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>,
parameters: &IntegrationParameters<N>
)
Initializes the internal velocity constraints of a body.
pub fn warmstart_internal_velocity_constraints(
&mut self,
dvels: &mut Matrix<N, Dynamic, Const<1_usize>, SliceStorageMut<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
)
pub fn warmstart_internal_velocity_constraints(
&mut self,
dvels: &mut Matrix<N, Dynamic, Const<1_usize>, SliceStorageMut<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
)
For warmstarting the solver, modifies the delta velocity applied by the internal constraints of this body.
pub fn step_solve_internal_velocity_constraints(
&mut self,
dvels: &mut Matrix<N, Dynamic, Const<1_usize>, SliceStorageMut<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
)
pub fn step_solve_internal_velocity_constraints(
&mut self,
dvels: &mut Matrix<N, Dynamic, Const<1_usize>, SliceStorageMut<'_, N, Dynamic, Const<1_usize>, Const<1_usize>, Dynamic>>
)
Execute one step for the iterative resolution of this body’s internal velocity constraints.
pub fn step_solve_internal_position_constraints(
&mut self,
parameters: &IntegrationParameters<N>
)
pub fn step_solve_internal_position_constraints(
&mut self,
parameters: &IntegrationParameters<N>
)
Execute one step for the iterative resolution of this body’s internal position constraints.
Add the given inertia to the local inertia of this body part.
Gets the velocity of the given point of this body.
Apply a force at the center of mass of a part of this body.
Apply a local force at the center of mass of a part of this body.
Apply a force at a given point of a part of this body.
Apply a local force at a given point of a part of this body.
Apply a force at a given local point of a part of this body.
Apply a local force at a given local point of a part of this body.
Update whether this body needs to be waken up after a user-interaction.
The number of degrees of freedom (DOF) of this body, taking its status into account. Read more
fn status_dependent_body_part_velocity(
&self,
part: &(dyn BodyPart<N> + 'static)
) -> Velocity2<N>
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
Whether or not the status of this body is dynamic.
Whether or not the status of this body is kinematic.
Auto Trait Implementations
impl<N> !RefUnwindSafe for Multibody<N>
impl<N> !UnwindSafe for Multibody<N>
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: 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
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub 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. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.