[−][src]Struct amethyst_physics::objects::PhysicsHandle
The physics handle is used to track the physics resource lifetime. Indeed you don't have to care about dropping resources (life a RigidBody or a Shape) because they are automatically cleaned out once all PhysicsHandle to that object are dropped.
Worth to mention that you can store these handle anywhere, and the GC will always take care of its dropping.
If you need a copy of this resource you can simply use the function clone()
.
All Physics Servers APIs want to deal directly with the PhysicsTag.
Use the method get()
to retrieve it.
Keep in mind that it's lifetime is not tracked by the GC, thus is not a replacement of the PhysicsHandle.
Methods
impl<T: PhysicsTag> PhysicsHandle<T>
[src]
pub fn new(
tag: T,
garbage_collector: Arc<RwLock<PhysicsGarbageCollector>>
) -> Self
[src]
tag: T,
garbage_collector: Arc<RwLock<PhysicsGarbageCollector>>
) -> Self
Creates new PhysicsHandle
.
This function must be called only by a physics backend.
pub fn get(&self) -> T
[src]
Returns the PhysicsTag Keep in mind that this doesn't alter the resource lifetime in anyway.
Trait Implementations
impl<T: PhysicsTag> Clone for PhysicsHandle<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: PhysicsTag> Debug for PhysicsHandle<T>
[src]
impl<T: PhysicsTag> Component for PhysicsHandle<T>
[src]
type Storage = FlaggedStorage<PhysicsHandle<T>, DenseVecStorage<PhysicsHandle<T>>>
Associated storage type for this component.
Auto Trait Implementations
impl<T> Sync for PhysicsHandle<T>
impl<T> Send for PhysicsHandle<T>
impl<T> Unpin for PhysicsHandle<T>
impl<T> UnwindSafe for PhysicsHandle<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> RefUnwindSafe for PhysicsHandle<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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,