Implement the ability to run multiple CCD substeps.

This commit is contained in:
Crozet Sébastien
2021-03-29 17:21:49 +02:00
parent 8173e7ada2
commit a733f97028
12 changed files with 244 additions and 97 deletions

View File

@@ -21,6 +21,13 @@ impl CollisionDetectionCounters {
narrow_phase_time: Timer::new(),
}
}
/// Resets all the coounters and timers.
pub fn reset(&mut self) {
self.ncontact_pairs = 0;
self.broad_phase_time.reset();
self.narrow_phase_time.reset();
}
}
impl Display for CollisionDetectionCounters {

View File

@@ -114,6 +114,18 @@ impl Counters {
pub fn set_ncontact_pairs(&mut self, n: usize) {
self.cd.ncontact_pairs = n;
}
/// Resets all the counters and timers.
pub fn reset(&mut self) {
if self.enabled {
self.step_time.reset();
self.custom.reset();
self.stages.reset();
self.cd.reset();
self.solver.reset();
self.ccd.reset();
}
}
}
macro_rules! measure_method {

View File

@@ -27,6 +27,15 @@ impl StagesCounters {
ccd_time: Timer::new(),
}
}
/// Resets all the counters and timers.
pub fn reset(&mut self) {
self.update_time.reset();
self.collision_detection_time.reset();
self.island_construction_time.reset();
self.solver_time.reset();
self.ccd_time.reset();
}
}
impl Display for StagesCounters {