Impl Default for a few structs
This commit is contained in:
committed by
Sébastien Crozet
parent
936f655c67
commit
7aa94e994f
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user