pub struct NarrowphaseGpuKernel;Expand description
Narrowphase collision detection kernel (CPU mock with simplified GJK/SAT).
For AABB vs AABB pairs the kernel uses SAT (Separating Axis Theorem) which is exact. For more general shapes a GJK iteration would be used.
Implementations§
Source§impl NarrowphaseGpuKernel
impl NarrowphaseGpuKernel
Sourcepub fn test_aabb_pair(
&self,
prim_a: u32,
aabb_a: &AabbGpu,
prim_b: u32,
aabb_b: &AabbGpu,
) -> Option<ContactResult>
pub fn test_aabb_pair( &self, prim_a: u32, aabb_a: &AabbGpu, prim_b: u32, aabb_b: &AabbGpu, ) -> Option<ContactResult>
Test a single AABB pair using SAT; returns Some(ContactResult) on
contact, None otherwise.
Sourcepub fn gjk_intersect(&self, a: &AabbGpu, b: &AabbGpu) -> (bool, f32)
pub fn gjk_intersect(&self, a: &AabbGpu, b: &AabbGpu) -> (bool, f32)
Run GJK for two AABB shapes (CPU mock).
Returns true if the shapes intersect, along with the final simplex
distance (0.0 on intersection).
Sourcepub fn dispatch(
&self,
pairs: &[CollisionPair],
aabbs: &[AabbGpu],
) -> Vec<ContactResult>
pub fn dispatch( &self, pairs: &[CollisionPair], aabbs: &[AabbGpu], ) -> Vec<ContactResult>
Dispatch narrowphase over a list of broadphase pairs and AABBs.
Trait Implementations§
Source§impl Debug for NarrowphaseGpuKernel
impl Debug for NarrowphaseGpuKernel
Source§impl Default for NarrowphaseGpuKernel
impl Default for NarrowphaseGpuKernel
Source§fn default() -> NarrowphaseGpuKernel
fn default() -> NarrowphaseGpuKernel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NarrowphaseGpuKernel
impl RefUnwindSafe for NarrowphaseGpuKernel
impl Send for NarrowphaseGpuKernel
impl Sync for NarrowphaseGpuKernel
impl Unpin for NarrowphaseGpuKernel
impl UnsafeUnpin for NarrowphaseGpuKernel
impl UnwindSafe for NarrowphaseGpuKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more