pub struct GpuCollisionPipeline {
pub broadphase: GpuBroadphase,
pub narrowphase: GpuNarrowphase,
pub contact_cache: GpuContactCache,
pub aabb_tree: GpuAabbTree,
pub contacts: Vec<ContactResult>,
pub manifolds: Vec<PersistentManifoldGpu>,
pub cumulative_stats: CollisionKernelStats,
}Expand description
Full GPU collision pipeline: broadphase (SAP) + narrowphase (GJK) + persistent contact cache with warmstarting.
Intended as the primary collision API. Configure once, call step each
physics tick to get a fresh contact list.
Fields§
§broadphase: GpuBroadphaseSAP broadphase.
narrowphase: GpuNarrowphaseGJK narrowphase.
contact_cache: GpuContactCachePersistent contact cache.
aabb_tree: GpuAabbTreeAABB tree (rebuilt each frame or on-demand).
contacts: Vec<ContactResult>Contact list from the most recent step.
manifolds: Vec<PersistentManifoldGpu>Persistent manifolds.
cumulative_stats: CollisionKernelStatsCumulative stats since pipeline creation.
Implementations§
Source§impl GpuCollisionPipeline
impl GpuCollisionPipeline
Sourcepub fn new(margin: f32, max_cache_age: u32) -> Self
pub fn new(margin: f32, max_cache_age: u32) -> Self
Create a new GpuCollisionPipeline with sensible defaults.
Sourcepub fn step(&mut self, aabbs: &[AabbGpu])
pub fn step(&mut self, aabbs: &[AabbGpu])
Run one full collision step using SAP broadphase + GJK narrowphase.
Steps:
- Rebuild the AABB tree.
- Run SAP broadphase.
- Run GJK narrowphase on each pair.
- Refresh contact cache; apply warmstart data.
- Update persistent manifolds.
- Age out stale cache entries.
Sourcepub fn total_contact_points(&self) -> usize
pub fn total_contact_points(&self) -> usize
Total active contact points across all manifolds.
Sourcepub fn frame_stats(&self) -> CollisionKernelStats
pub fn frame_stats(&self) -> CollisionKernelStats
Get a snapshot of per-frame broadphase + narrowphase stats.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuCollisionPipeline
impl RefUnwindSafe for GpuCollisionPipeline
impl Send for GpuCollisionPipeline
impl Sync for GpuCollisionPipeline
impl Unpin for GpuCollisionPipeline
impl UnsafeUnpin for GpuCollisionPipeline
impl UnwindSafe for GpuCollisionPipeline
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