pub struct Counters {
pub enabled: bool,
pub step_time: Timer,
pub custom: Timer,
pub stages: StagesCounters,
pub cd: CollisionDetectionCounters,
pub solver: SolverCounters,
pub ccd: CCDCounters,
}Expand description
Aggregation of all the performances counters tracked by nphysics.
Fields§
§enabled: boolWhether thi counter is enabled or not.
step_time: TimerTimer for a whole timestep.
custom: TimerTimer used for debugging.
stages: StagesCountersCounters of every satge of one time step.
cd: CollisionDetectionCountersCounters of the collision-detection stage.
solver: SolverCountersCounters of the constraints resolution and force computation stage.
ccd: CCDCountersCounters for the CCD resolution stage.
Implementations§
Source§impl Counters
impl Counters
Sourcepub fn step_started(&mut self)
pub fn step_started(&mut self)
Notify that the time-step has started.
Sourcepub fn step_completed(&mut self)
pub fn step_completed(&mut self)
Notfy that the time-step has finished.
Sourcepub fn custom_started(&mut self)
pub fn custom_started(&mut self)
Notify that the custom operation has started.
Sourcepub fn custom_completed(&mut self)
pub fn custom_completed(&mut self)
Notfy that the custom operation has finished.
Sourcepub fn custom_time(&self) -> f64
pub fn custom_time(&self) -> f64
Total time of a custom event.
Sourcepub fn set_nconstraints(&mut self, n: usize)
pub fn set_nconstraints(&mut self, n: usize)
Set the number of constraints generated.
Sourcepub fn set_ncontacts(&mut self, n: usize)
pub fn set_ncontacts(&mut self, n: usize)
Set the number of contacts generated.
Sourcepub fn set_ncontact_pairs(&mut self, n: usize)
pub fn set_ncontact_pairs(&mut self, n: usize)
Set the number of contact pairs generated.
Source§impl Counters
impl Counters
Sourcepub fn update_started(&mut self)
pub fn update_started(&mut self)
Start this timer.
Sourcepub fn update_completed(&mut self)
pub fn update_completed(&mut self)
Stop this timer.
Sourcepub fn update_time(&self) -> f64
pub fn update_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn collision_detection_started(&mut self)
pub fn collision_detection_started(&mut self)
Start this timer.
Sourcepub fn collision_detection_completed(&mut self)
pub fn collision_detection_completed(&mut self)
Stop this timer.
Sourcepub fn collision_detection_time(&self) -> f64
pub fn collision_detection_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn island_construction_started(&mut self)
pub fn island_construction_started(&mut self)
Start this timer.
Sourcepub fn island_construction_completed(&mut self)
pub fn island_construction_completed(&mut self)
Stop this timer.
Sourcepub fn island_construction_time(&self) -> f64
pub fn island_construction_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn solver_started(&mut self)
pub fn solver_started(&mut self)
Start this timer.
Sourcepub fn solver_completed(&mut self)
pub fn solver_completed(&mut self)
Stop this timer.
Sourcepub fn solver_time(&self) -> f64
pub fn solver_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn ccd_started(&mut self)
pub fn ccd_started(&mut self)
Start this timer.
Sourcepub fn ccd_completed(&mut self)
pub fn ccd_completed(&mut self)
Stop this timer.
Source§impl Counters
impl Counters
Sourcepub fn assembly_started(&mut self)
pub fn assembly_started(&mut self)
Start this timer.
Sourcepub fn assembly_completed(&mut self)
pub fn assembly_completed(&mut self)
Stop this timer.
Sourcepub fn assembly_time(&self) -> f64
pub fn assembly_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn velocity_resolution_started(&mut self)
pub fn velocity_resolution_started(&mut self)
Start this timer.
Sourcepub fn velocity_resolution_completed(&mut self)
pub fn velocity_resolution_completed(&mut self)
Stop this timer.
Sourcepub fn velocity_resolution_time(&self) -> f64
pub fn velocity_resolution_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn velocity_update_started(&mut self)
pub fn velocity_update_started(&mut self)
Start this timer.
Sourcepub fn velocity_update_completed(&mut self)
pub fn velocity_update_completed(&mut self)
Stop this timer.
Sourcepub fn velocity_update_time(&self) -> f64
pub fn velocity_update_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn position_resolution_started(&mut self)
pub fn position_resolution_started(&mut self)
Start this timer.
Sourcepub fn position_resolution_completed(&mut self)
pub fn position_resolution_completed(&mut self)
Stop this timer.
Sourcepub fn position_resolution_time(&self) -> f64
pub fn position_resolution_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn broad_phase_started(&mut self)
pub fn broad_phase_started(&mut self)
Start this timer.
Sourcepub fn broad_phase_completed(&mut self)
pub fn broad_phase_completed(&mut self)
Stop this timer.
Sourcepub fn broad_phase_time(&self) -> f64
pub fn broad_phase_time(&self) -> f64
Gets the time elapsed for this timer.
Source§impl Counters
impl Counters
Sourcepub fn narrow_phase_started(&mut self)
pub fn narrow_phase_started(&mut self)
Start this timer.
Sourcepub fn narrow_phase_completed(&mut self)
pub fn narrow_phase_completed(&mut self)
Stop this timer.
Sourcepub fn narrow_phase_time(&self) -> f64
pub fn narrow_phase_time(&self) -> f64
Gets the time elapsed for this timer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Counters
impl RefUnwindSafe for Counters
impl Send for Counters
impl Sync for Counters
impl Unpin for Counters
impl UnsafeUnpin for Counters
impl UnwindSafe for Counters
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 moreSource§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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.