pub struct BroadphaseGpuKernel {
pub margin: f32,
}Expand description
Broadphase collision detection kernel (CPU mock of a GPU dispatch).
Detects all overlapping AABB pairs from a flat list of AabbGpu.
Fields§
§margin: f32Inflation margin added to each AABB before testing.
Implementations§
Source§impl BroadphaseGpuKernel
impl BroadphaseGpuKernel
Sourcepub fn new(margin: f32) -> Self
pub fn new(margin: f32) -> Self
Create a new BroadphaseGpuKernel with the given inflation margin.
Sourcepub fn dispatch(&self, aabbs: &[AabbGpu]) -> Vec<CollisionPair>
pub fn dispatch(&self, aabbs: &[AabbGpu]) -> Vec<CollisionPair>
Dispatch the broadphase over aabbs.
Returns all overlapping pairs (canonical form, a < b).
Sourcepub fn dispatch_bvh(&self, aabbs: &[AabbGpu]) -> Vec<CollisionPair>
pub fn dispatch_bvh(&self, aabbs: &[AabbGpu]) -> Vec<CollisionPair>
BVH-accelerated broadphase dispatch.
Trait Implementations§
Source§impl Debug for BroadphaseGpuKernel
impl Debug for BroadphaseGpuKernel
Source§impl Default for BroadphaseGpuKernel
impl Default for BroadphaseGpuKernel
Source§fn default() -> BroadphaseGpuKernel
fn default() -> BroadphaseGpuKernel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BroadphaseGpuKernel
impl RefUnwindSafe for BroadphaseGpuKernel
impl Send for BroadphaseGpuKernel
impl Sync for BroadphaseGpuKernel
impl Unpin for BroadphaseGpuKernel
impl UnsafeUnpin for BroadphaseGpuKernel
impl UnwindSafe for BroadphaseGpuKernel
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