pub struct GpuNarrowphase {
pub max_iterations: usize,
pub stats: CollisionKernelStats,
}Expand description
GPU narrowphase kernel performing parallel GJK distance queries.
Each pair from the broadphase is resolved with a dedicated GJK iteration to compute exact contact information.
Fields§
§max_iterations: usizeMaximum GJK iterations before declaring intersection.
stats: CollisionKernelStatsStats from the most recent dispatch.
Implementations§
Source§impl GpuNarrowphase
impl GpuNarrowphase
Sourcepub fn new(max_iterations: usize) -> Self
pub fn new(max_iterations: usize) -> Self
Create a new GpuNarrowphase with a given iteration limit.
Sourcepub fn gjk_distance(&self, a: &AabbGpu, b: &AabbGpu) -> GjkResult
pub fn gjk_distance(&self, a: &AabbGpu, b: &AabbGpu) -> GjkResult
Run a GJK distance query for two AabbGpu shapes.
Sourcepub fn sat_depth(&self, a: &AabbGpu, b: &AabbGpu) -> Option<(f32, [f32; 3])>
pub fn sat_depth(&self, a: &AabbGpu, b: &AabbGpu) -> Option<(f32, [f32; 3])>
Compute penetration depth from an overlapping AABB pair using SAT.
Returns None if the shapes do not overlap.
Sourcepub fn dispatch(
&mut self,
pairs: &[CollisionPair],
aabbs: &[AabbGpu],
) -> Vec<ContactResult>
pub fn dispatch( &mut self, pairs: &[CollisionPair], aabbs: &[AabbGpu], ) -> Vec<ContactResult>
Dispatch the narrowphase over a list of broadphase pairs.
Returns full ContactResult list with GJK/SAT contact data.
Trait Implementations§
Source§impl Debug for GpuNarrowphase
impl Debug for GpuNarrowphase
Source§impl Default for GpuNarrowphase
impl Default for GpuNarrowphase
Source§fn default() -> GpuNarrowphase
fn default() -> GpuNarrowphase
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GpuNarrowphase
impl RefUnwindSafe for GpuNarrowphase
impl Send for GpuNarrowphase
impl Sync for GpuNarrowphase
impl Unpin for GpuNarrowphase
impl UnsafeUnpin for GpuNarrowphase
impl UnwindSafe for GpuNarrowphase
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