Struct nphysics3d::object::BodySet [−][src]
pub struct BodySet<N: Real> { /* fields omitted */ }
A set containing all the bodies added to the world.
Methods
impl<N: Real> BodySet<N>
[src]
impl<N: Real> BodySet<N>
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new empty set of bodies.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
The number of bodies in this set.
pub fn are_same_body(&self, body1: BodyHandle, body2: BodyHandle) -> bool
[src]
pub fn are_same_body(&self, body1: BodyHandle, body2: BodyHandle) -> bool
Check if the two given handles identify the same body.
In particular, returns true
if both handles indentify multibody links belonging
to the same multibody.
pub fn update_kinematics(&mut self)
[src]
pub fn update_kinematics(&mut self)
Update the kinematics of all the bodies.
pub fn clear_dynamics(&mut self)
[src]
pub fn clear_dynamics(&mut self)
Clear the dynamics of all the bodies.
pub fn update_dynamics(
&mut self,
gravity: &Vector<N>,
params: &IntegrationParameters<N>,
workspace: &mut MultibodyWorkspace<N>
)
[src]
pub fn update_dynamics(
&mut self,
gravity: &Vector<N>,
params: &IntegrationParameters<N>,
workspace: &mut MultibodyWorkspace<N>
)
Update the dynamics of all the bodies.
pub fn add_rigid_body(
&mut self,
position: Isometry<N>,
local_inertia: Inertia<N>,
local_com: Point<N>
) -> BodyHandle
[src]
pub fn add_rigid_body(
&mut self,
position: Isometry<N>,
local_inertia: Inertia<N>,
local_com: Point<N>
) -> BodyHandle
Add a rigid body to the set and return its handle.
pub fn add_multibody_link<J: Joint<N>>(
&mut self,
parent: BodyHandle,
joint: J,
parent_shift: Vector<N>,
body_shift: Vector<N>,
local_inertia: Inertia<N>,
local_com: Point<N>
) -> BodyHandle
[src]
pub fn add_multibody_link<J: Joint<N>>(
&mut self,
parent: BodyHandle,
joint: J,
parent_shift: Vector<N>,
body_shift: Vector<N>,
local_inertia: Inertia<N>,
local_com: Point<N>
) -> BodyHandle
Add a multibody link to the set and return its handle.
pub fn remove_body(&mut self, body: BodyHandle)
[src]
pub fn remove_body(&mut self, body: BodyHandle)
Remove a body from this set.
If body
identify a mutibody link, the whole multibody is removed.
pub fn remove_multibody_links(&mut self, body_parts: &[BodyHandle])
[src]
pub fn remove_multibody_links(&mut self, body_parts: &[BodyHandle])
Remove some multibody links.
If a multibody link which has descendent is removed, its immediat descendent in the kinematic tree becomes the root of a new multibody and its joint is replaced by a free joint attached to the ground.
pub fn contains(&self, body: BodyHandle) -> bool
[src]
pub fn contains(&self, body: BodyHandle) -> bool
Checks that the given handle identifies a valid body part.
Returns true
if body.is_ground()
too.
pub fn body(&self, body: BodyHandle) -> Body<N>
[src]
pub fn body(&self, body: BodyHandle) -> Body<N>
Reference to the body identified by body
.
Panics if the body part is not found.
pub fn body_mut(&mut self, body: BodyHandle) -> BodyMut<N>
[src]
pub fn body_mut(&mut self, body: BodyHandle) -> BodyMut<N>
Mutable reference to the body identified by body
.
Panics if the body part is not found.
pub fn body_part(&self, body: BodyHandle) -> BodyPart<N>
[src]
pub fn body_part(&self, body: BodyHandle) -> BodyPart<N>
Reference to the body part identified by body
.
Panics if the body part is not found.
pub fn body_part_mut(&mut self, body: BodyHandle) -> BodyPartMut<N>
[src]
pub fn body_part_mut(&mut self, body: BodyHandle) -> BodyPartMut<N>
Mutable reference to the body part identified by body
.
Panics if the body part is not found.
pub fn multibody(&self, body: BodyHandle) -> Option<&Multibody<N>>
[src]
pub fn multibody(&self, body: BodyHandle) -> Option<&Multibody<N>>
Reference to the multibody containing the multibody link identified by body
.
Returns None
if it is not found or does not identify a multibody link.
pub fn multibody_mut(&mut self, body: BodyHandle) -> Option<&mut Multibody<N>>
[src]
pub fn multibody_mut(&mut self, body: BodyHandle) -> Option<&mut Multibody<N>>
Mutable reference to the multibody containing the multibody link identified by body
.
Returns None
if it is not found or does not identify a multibody link.
pub fn multibody_link(&self, body: BodyHandle) -> Option<MultibodyLinkRef<N>>
[src]
pub fn multibody_link(&self, body: BodyHandle) -> Option<MultibodyLinkRef<N>>
Reference to the multibody link identified by body
.
Returns None
if it is not found or does not identify a multibody link.
pub fn multibody_link_mut(
&mut self,
body: BodyHandle
) -> Option<MultibodyLinkMut<N>>
[src]
pub fn multibody_link_mut(
&mut self,
body: BodyHandle
) -> Option<MultibodyLinkMut<N>>
Mutable reference to the multibody link identified by body
.
Returns None
if it is not found or does not identify a multibody link.
pub fn rigid_body(&self, body: BodyHandle) -> Option<&RigidBody<N>>
[src]
pub fn rigid_body(&self, body: BodyHandle) -> Option<&RigidBody<N>>
Reference to the rigid body identified by body
.
Returns None
if it is not found or does not identify a rigid body.
pub fn rigid_body_mut(&mut self, body: BodyHandle) -> Option<&mut RigidBody<N>>
[src]
pub fn rigid_body_mut(&mut self, body: BodyHandle) -> Option<&mut RigidBody<N>>
Mutable reference to the rigid body identified by body
.
Returns None
if it is not found or does not identify a rigid body.
ⓘImportant traits for Map<I, F>pub fn rigid_bodies(
&self
) -> Map<Iter<'a, RigidBody<N>>, fn(_: (usize, &RigidBody<N>)) -> &RigidBody<N>>
[src]
pub fn rigid_bodies(
&self
) -> Map<Iter<'a, RigidBody<N>>, fn(_: (usize, &RigidBody<N>)) -> &RigidBody<N>>
Iterator yielding all the rigid bodies on this set.
ⓘImportant traits for Map<I, F>pub fn rigid_bodies_mut(
&mut self
) -> Map<IterMut<'a, RigidBody<N>>, fn(_: (usize, &mut RigidBody<N>)) -> &mut RigidBody<N>>
[src]
pub fn rigid_bodies_mut(
&mut self
) -> Map<IterMut<'a, RigidBody<N>>, fn(_: (usize, &mut RigidBody<N>)) -> &mut RigidBody<N>>
Mutable iterator yielding all the rigid bodies on this set.
ⓘImportant traits for Map<I, F>pub fn multibodies(
&self
) -> Map<Iter<'a, Multibody<N>>, fn(_: (usize, &Multibody<N>)) -> &Multibody<N>>
[src]
pub fn multibodies(
&self
) -> Map<Iter<'a, Multibody<N>>, fn(_: (usize, &Multibody<N>)) -> &Multibody<N>>
Iterator yielding all the multibodies on this set.
ⓘImportant traits for Map<I, F>pub fn multibodies_mut(
&mut self
) -> Map<IterMut<'a, Multibody<N>>, fn(_: (usize, &mut Multibody<N>)) -> &mut Multibody<N>>
[src]
pub fn multibodies_mut(
&mut self
) -> Map<IterMut<'a, Multibody<N>>, fn(_: (usize, &mut Multibody<N>)) -> &mut Multibody<N>>
Mutable iterator yielding all the multibodies on this set.
pub fn bodies_mut(&mut self) -> BodiesMut<N>
[src]
pub fn bodies_mut(&mut self) -> BodiesMut<N>
Mutable iterator yielding all the bodies on this set.