[][src]Struct resphys::PhysicsWorld

pub struct PhysicsWorld<T> {
    pub collision_graph: CollisionGraph,
    // some fields omitted
}

T - User supplied type used as a tag, present in all events

Fields

collision_graph: CollisionGraph

Implementations

impl<T: Copy> PhysicsWorld<T>[src]

pub fn new() -> Self[src]

pub fn remove_collider(
    &mut self,
    handle: ColliderHandle,
    bodies: &mut BodySet,
    colliders: &mut ColliderSet<T>
)
[src]

Panics if there's no collider associated with the handle.
When collider has active collisions/overlaps the Ended event is scheduled to be sent next frame.

pub fn remove_body(
    &mut self,
    handle: BodyHandle,
    bodies: &mut BodySet,
    colliders: &mut ColliderSet<T>
)
[src]

Panics if there's no body associated with the handle.
All associated colliders are also removed. When any collider has active collisions/overlaps the Ended event is scheduled to be sent next frame.

pub fn interactions_of(
    &self,
    handle: ColliderHandle
) -> impl Iterator<Item = (ColliderHandle, &Interaction)>
[src]

Interactions are defined per collider.
To get only collisions or overlaps use collisions_of or overlaps_of respectively.

pub fn collisions_of(
    &self,
    handle: ColliderHandle
) -> impl Iterator<Item = (ColliderHandle, &CollisionInfo)>
[src]

Interactions are defined per collider.
To get only collisions or overlaps use collisions_of or overlaps_of respectively.

pub fn overlaps_of(
    &self,
    handle: ColliderHandle
) -> impl Iterator<Item = (ColliderHandle, &Interaction)>
[src]

Interactions are defined per collider.
To get only collisions or overlaps use collisions_of or overlaps_of respectively.

pub fn overlap_test<'a>(
    &self,
    position: Vec2,
    half_exts: Vec2,
    collision_mask: u32,
    bodies: &'a BodySet,
    colliders: &'a ColliderSet<T>
) -> impl Iterator<Item = ColliderHandle> + 'a
[src]

Returns an iterator to ColliderHandle's of colliders overlapping with given AABB.
position is the center of the AABB

pub fn project_ray<'a>(
    &self,
    ray: &'a Ray,
    collision_mask: u32,
    bodies: &'a BodySet,
    colliders: &'a ColliderSet<T>
) -> impl Iterator<Item = (ColliderHandle, Raycast)> + 'a
[src]

Returns an iterator to ColliderHandle's of colliders overlapping with given ray.

pub fn events(&self) -> &Vec<ContactEvent<T>>[src]

pub fn step(
    &mut self,
    dt: f32,
    bodies: &mut BodySet,
    colliders: &mut ColliderSet<T>
)
[src]

Trait Implementations

impl<T: Copy> Default for PhysicsWorld<T>[src]

Auto Trait Implementations

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

impl<T> Send for PhysicsWorld<T> where
    T: Send

impl<T> Sync for PhysicsWorld<T> where
    T: Sync

impl<T> Unpin for PhysicsWorld<T> where
    T: Unpin

impl<T> UnwindSafe for PhysicsWorld<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.