diff options
Diffstat (limited to 'src/geometry')
| -rw-r--r-- | src/geometry/collider_set.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/geometry/collider_set.rs b/src/geometry/collider_set.rs index 3934472..7a2b6aa 100644 --- a/src/geometry/collider_set.rs +++ b/src/geometry/collider_set.rs @@ -23,6 +23,17 @@ impl ColliderSet { } } + /// Create a new set of colliders, with an initial capacity + /// for the set of colliders as well as the tracking of + /// modified colliders. + pub fn with_capacity(capacity: usize) -> Self { + ColliderSet { + colliders: Arena::with_capacity(capacity), + modified_colliders: Vec::with_capacity(capacity), + removed_colliders: Vec::new(), + } + } + pub(crate) fn take_modified(&mut self) -> Vec<ColliderHandle> { std::mem::take(&mut self.modified_colliders) } |
