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 rapier.
Fields§
§enabled: bool
Whether this counter is enabled or not.
step_time: Timer
Timer for a whole timestep.
custom: Timer
Timer used for debugging.
stages: StagesCounters
Counters of every stage of one time step.
cd: CollisionDetectionCounters
Counters of the collision-detection stage.
solver: SolverCounters
Counters of the constraints resolution and force computation stage.
ccd: CCDCounters
Counters 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)
Notify that the time-step has finished.
Sourcepub fn step_time_ms(&self) -> f64
pub fn step_time_ms(&self) -> f64
Total time spent for one of the physics engine, in milliseconds.
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)
Notify that the custom operation has finished.
Sourcepub fn custom_time(&self) -> Duration
pub fn custom_time(&self) -> Duration
Total time of a custom event.
Sourcepub fn custom_time_ms(&self) -> f64
pub fn custom_time_ms(&self) -> f64
Total time of a custom event, in milliseconds.
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_ms(&self) -> f64
pub fn update_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn collision_detection_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn island_construction_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn solver_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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.
Sourcepub fn ccd_time_ms(&self) -> f64
pub fn ccd_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
Source§impl Counters
impl Counters
Sourcepub fn query_pipeline_update_started(&mut self)
pub fn query_pipeline_update_started(&mut self)
Start this timer.
Sourcepub fn query_pipeline_update_completed(&mut self)
pub fn query_pipeline_update_completed(&mut self)
Stop this timer.
Sourcepub fn query_pipeline_update_time_ms(&self) -> f64
pub fn query_pipeline_update_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn assembly_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn velocity_resolution_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn velocity_update_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn broad_phase_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
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_ms(&self) -> f64
pub fn narrow_phase_time_ms(&self) -> f64
Gets the time elapsed for this timer, in milliseconds.
Trait Implementations§
impl Copy for Counters
Auto Trait Implementations§
impl Freeze for Counters
impl RefUnwindSafe for Counters
impl Send for Counters
impl Sync for Counters
impl Unpin 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<T> Pointable for T
impl<T> Pointable for T
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>
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.