diff options
Diffstat (limited to 'src/geometry')
| -rw-r--r-- | src/geometry/broad_phase_multi_sap/broad_phase.rs | 6 | ||||
| -rw-r--r-- | src/geometry/broad_phase_multi_sap/sap_proxy.rs | 6 | ||||
| -rw-r--r-- | src/geometry/collider_set.rs | 2 | ||||
| -rw-r--r-- | src/geometry/interaction_graph.rs | 6 | ||||
| -rw-r--r-- | src/geometry/narrow_phase.rs | 6 |
5 files changed, 25 insertions, 1 deletions
diff --git a/src/geometry/broad_phase_multi_sap/broad_phase.rs b/src/geometry/broad_phase_multi_sap/broad_phase.rs index 76d48fe..0ed12b6 100644 --- a/src/geometry/broad_phase_multi_sap/broad_phase.rs +++ b/src/geometry/broad_phase_multi_sap/broad_phase.rs @@ -116,6 +116,12 @@ pub struct BroadPhase { reporting: HashMap<(u32, u32), bool>, // Workspace } +impl Default for BroadPhase { + fn default() -> Self { + Self::new() + } +} + impl BroadPhase { /// Create a new empty broad-phase. pub fn new() -> Self { diff --git a/src/geometry/broad_phase_multi_sap/sap_proxy.rs b/src/geometry/broad_phase_multi_sap/sap_proxy.rs index ed834bd..dff46ff 100644 --- a/src/geometry/broad_phase_multi_sap/sap_proxy.rs +++ b/src/geometry/broad_phase_multi_sap/sap_proxy.rs @@ -87,6 +87,12 @@ pub struct SAPProxies { pub first_free: SAPProxyIndex, } +impl Default for SAPProxies { + fn default() -> Self { + Self::new() + } +} + impl SAPProxies { pub fn new() -> Self { Self { diff --git a/src/geometry/collider_set.rs b/src/geometry/collider_set.rs index 9584015..556d190 100644 --- a/src/geometry/collider_set.rs +++ b/src/geometry/collider_set.rs @@ -9,7 +9,7 @@ use crate::geometry::{ColliderChanges, ColliderHandle}; use std::ops::{Index, IndexMut}; #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] -#[derive(Clone)] +#[derive(Clone, Default)] /// A set of colliders that can be handled by a physics `World`. pub struct ColliderSet { pub(crate) colliders: Arena<Collider>, diff --git a/src/geometry/interaction_graph.rs b/src/geometry/interaction_graph.rs index e2cc218..b535fa5 100644 --- a/src/geometry/interaction_graph.rs +++ b/src/geometry/interaction_graph.rs @@ -14,6 +14,12 @@ pub struct InteractionGraph<N, E> { pub(crate) graph: Graph<N, E>, } +impl<N: Copy, E> Default for InteractionGraph<N, E> { + fn default() -> Self { + Self::new() + } +} + impl<N: Copy, E> InteractionGraph<N, E> { /// Creates a new empty collection of collision objects. pub fn new() -> Self { diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs index 18900b9..adaf219 100644 --- a/src/geometry/narrow_phase.rs +++ b/src/geometry/narrow_phase.rs @@ -62,6 +62,12 @@ pub struct NarrowPhase { pub(crate) type ContactManifoldIndex = usize; +impl Default for NarrowPhase { + fn default() -> Self { + Self::new() + } +} + impl NarrowPhase { /// Creates a new empty narrow-phase. pub fn new() -> Self { |
