pub struct GpuContactCache {
pub entries: Vec<ContactCacheEntry>,
pub max_age_frames: u32,
}Expand description
Persistent contact cache for GPU broadphase/narrowphase warmstarting.
Maps body-pair keys to cached impulse data from the previous frame.
Entries are aged out after max_age_frames frames without a refresh.
Fields§
§entries: Vec<ContactCacheEntry>Stored entries.
max_age_frames: u32Maximum age before an entry is evicted.
Implementations§
Source§impl GpuContactCache
impl GpuContactCache
Sourcepub fn find(&self, a: u32, b: u32) -> Option<&ContactCacheEntry>
pub fn find(&self, a: u32, b: u32) -> Option<&ContactCacheEntry>
Look up a cached entry for the given pair key.
Sourcepub fn find_mut(&mut self, a: u32, b: u32) -> Option<&mut ContactCacheEntry>
pub fn find_mut(&mut self, a: u32, b: u32) -> Option<&mut ContactCacheEntry>
Look up a cached entry mutably.
Sourcepub fn insert(&mut self, pair: &CollisionPair, contact: &ContactResult)
pub fn insert(&mut self, pair: &CollisionPair, contact: &ContactResult)
Insert or refresh a contact cache entry.
Sourcepub fn advance_frame(&mut self)
pub fn advance_frame(&mut self)
Advance the cache by one frame: age entries and evict stale ones.
Trait Implementations§
Source§impl Debug for GpuContactCache
impl Debug for GpuContactCache
Source§impl Default for GpuContactCache
impl Default for GpuContactCache
Source§fn default() -> GpuContactCache
fn default() -> GpuContactCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GpuContactCache
impl RefUnwindSafe for GpuContactCache
impl Send for GpuContactCache
impl Sync for GpuContactCache
impl Unpin for GpuContactCache
impl UnsafeUnpin for GpuContactCache
impl UnwindSafe for GpuContactCache
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