[][src]Struct amethyst_physics::objects::PhysicsHandle

pub struct PhysicsHandle<T: PhysicsTag> { /* fields omitted */ }

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]

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]

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

impl<T> RefUnwindSafe for PhysicsHandle<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Any for T where
    T: Any

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> Event for T where
    T: Send + Sync + 'static,