[−][src]Struct resphys::PhysicsWorld
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]
&mut self,
handle: ColliderHandle,
bodies: &mut BodySet,
colliders: &mut ColliderSet<T>
)
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]
&mut self,
handle: BodyHandle,
bodies: &mut BodySet,
colliders: &mut ColliderSet<T>
)
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]
&self,
handle: ColliderHandle
) -> impl Iterator<Item = (ColliderHandle, &Interaction)>
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]
&self,
handle: ColliderHandle
) -> impl Iterator<Item = (ColliderHandle, &CollisionInfo)>
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]
&self,
handle: ColliderHandle
) -> impl Iterator<Item = (ColliderHandle, &Interaction)>
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]
&self,
position: Vec2,
half_exts: Vec2,
collision_mask: u32,
bodies: &'a BodySet,
colliders: &'a ColliderSet<T>
) -> impl Iterator<Item = ColliderHandle> + 'a
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]
&self,
ray: &'a Ray,
collision_mask: u32,
bodies: &'a BodySet,
colliders: &'a ColliderSet<T>
) -> impl Iterator<Item = (ColliderHandle, Raycast)> + 'a
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]
&mut self,
dt: f32,
bodies: &mut BodySet,
colliders: &mut ColliderSet<T>
)
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for PhysicsWorld<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PhysicsWorld<T> where
T: Send,
T: Send,
impl<T> Sync for PhysicsWorld<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PhysicsWorld<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PhysicsWorld<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,