diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-04-30 11:37:58 +0200 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-04-30 11:37:58 +0200 |
| commit | 2dfbd9ae92c139e306afc87994adac82489f30eb (patch) | |
| tree | c5b9c5e6fcb5561421e2b4b9d99f28e4c83c745e /src/dynamics/island_manager.rs | |
| parent | ac8ec8e3517c8d9baf8219c04ce907028d70901b (diff) | |
| download | rapier-2dfbd9ae92c139e306afc87994adac82489f30eb.tar.gz rapier-2dfbd9ae92c139e306afc87994adac82489f30eb.tar.bz2 rapier-2dfbd9ae92c139e306afc87994adac82489f30eb.zip | |
Add comments.
Diffstat (limited to 'src/dynamics/island_manager.rs')
| -rw-r--r-- | src/dynamics/island_manager.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dynamics/island_manager.rs b/src/dynamics/island_manager.rs index 551e5a4..b79cdb2 100644 --- a/src/dynamics/island_manager.rs +++ b/src/dynamics/island_manager.rs @@ -6,6 +6,8 @@ use crate::dynamics::{ use crate::geometry::{ColliderParent, InteractionGraph, NarrowPhase}; use crate::math::Real; +/// Structure responsible for maintaining the set of active rigid-bodies, and +/// putting non-moving rigid-bodies to sleep to save computation times. #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] pub struct IslandManager { pub(crate) active_dynamic_set: Vec<RigidBodyHandle>, @@ -19,6 +21,7 @@ pub struct IslandManager { } impl IslandManager { + /// Creates a new empty island manager. pub fn new() -> Self { Self { active_dynamic_set: vec![], @@ -34,6 +37,7 @@ impl IslandManager { self.active_islands.len() - 1 } + /// Update this data-structure after one or multiple rigid-bodies have been removed for `bodies`. pub fn cleanup_removed_rigid_bodies( &mut self, bodies: &mut impl ComponentSetMut<RigidBodyIds>, @@ -59,7 +63,7 @@ impl IslandManager { } } - pub fn rigid_body_removed( + pub(crate) fn rigid_body_removed( &mut self, removed_handle: RigidBodyHandle, removed_ids: &RigidBodyIds, |
