[−][src]Struct amethyst_physics::objects::PhysicsGarbageCollector
This garbage collector is used to store all the PhysicsTags to whom its associated handle get dropped.
The main benefit to use the Garbage Collector is that each PhysicsServer can implement its own destructor pipeline. Another benefit is that the user can store the PhysicsHandles even as resource or as prefer.
The alternative implementation was use a flagged storage.
Using a FlaggedStorage would have been not only less powerful (since the objects are not tracked
if stored elsewhere), but even more complicate.
Indeed the FlaggedStorage has an handy Event system, which returns only the storage Index of the
associated event.
What this mean in practice is that you don't have access to PhysicsTag ID because the Index get
removed and the only way would have been re implement a new storage with the capability to return
PhysicsTag on component drop.
Also the destruction pipeline is dictated by amethyst_physics
to each physics backend.
Considering the above the GC seems a better way.
Fields
bodies: Vec<PhysicsRigidBodyTag>
List of body no more used.
areas: Vec<PhysicsAreaTag>
List of areas no more used.
shapes: Vec<PhysicsShapeTag>
List of shapes no more used.
joints: Vec<PhysicsJointTag>
List of joints no mor used.
Trait Implementations
impl Default for PhysicsGarbageCollector
[src]
impl Debug for PhysicsGarbageCollector
[src]
Auto Trait Implementations
impl Sync for PhysicsGarbageCollector
impl Send for PhysicsGarbageCollector
impl Unpin for PhysicsGarbageCollector
impl UnwindSafe for PhysicsGarbageCollector
impl RefUnwindSafe for PhysicsGarbageCollector
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> TryDefault for T where
T: Default,
T: Default,