pub struct PyWarmStart {
pub cache: Vec<CachedImpulse>,
pub aging_factor: f64,
pub quality_threshold: f64,
pub max_age: u32,
}Expand description
Warm start cache for constraint impulses.
Fields§
§cache: Vec<CachedImpulse>Cached impulses from the previous solve.
aging_factor: f64Fraction of cached impulse to apply at the start of the next frame.
quality_threshold: f64Minimum quality threshold to keep a cached impulse.
max_age: u32Maximum number of frames to keep a cached impulse.
Implementations§
Source§impl PyWarmStart
impl PyWarmStart
Sourcepub fn store(&mut self, key: (u32, u32), lambda_n: f64, lambda_t: [f64; 2])
pub fn store(&mut self, key: (u32, u32), lambda_n: f64, lambda_t: [f64; 2])
Store an impulse for the next frame.
Sourcepub fn retrieve(&self, key: (u32, u32)) -> Option<(f64, [f64; 2])>
pub fn retrieve(&self, key: (u32, u32)) -> Option<(f64, [f64; 2])>
Retrieve the cached impulse for a body pair, scaled by aging factor.
Sourcepub fn age_and_prune(&mut self)
pub fn age_and_prune(&mut self)
Age all cached impulses and remove expired ones.
Trait Implementations§
Source§impl Clone for PyWarmStart
impl Clone for PyWarmStart
Source§fn clone(&self) -> PyWarmStart
fn clone(&self) -> PyWarmStart
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PyWarmStart
impl Debug for PyWarmStart
Source§impl Default for PyWarmStart
impl Default for PyWarmStart
Source§impl<'de> Deserialize<'de> for PyWarmStart
impl<'de> Deserialize<'de> for PyWarmStart
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PyWarmStart
impl RefUnwindSafe for PyWarmStart
impl Send for PyWarmStart
impl Sync for PyWarmStart
impl Unpin for PyWarmStart
impl UnsafeUnpin for PyWarmStart
impl UnwindSafe for PyWarmStart
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.