diff options
Diffstat (limited to 'src/dynamics')
| -rw-r--r-- | src/dynamics/rigid_body_set.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dynamics/rigid_body_set.rs b/src/dynamics/rigid_body_set.rs index 2ef91be..3145300 100644 --- a/src/dynamics/rigid_body_set.rs +++ b/src/dynamics/rigid_body_set.rs @@ -43,6 +43,14 @@ impl RigidBodySet { } } + /// Create a new set of rigid bodies, with an initial capacity. + pub fn with_capacity(capacity: usize) -> Self { + RigidBodySet { + bodies: Arena::with_capacity(capacity), + modified_bodies: Vec::with_capacity(capacity), + } + } + pub(crate) fn take_modified(&mut self) -> Vec<RigidBodyHandle> { std::mem::take(&mut self.modified_bodies) } |
