#[non_exhaustive]pub struct StageWork {Show 15 fields
pub sleep_scanned: u64,
pub parked: u64,
pub unparked: u64,
pub force_field_bodies: u64,
pub integrated: u64,
pub broadphase_primitives: u64,
pub broadphase_pairs: u64,
pub broadphase_box_tests: u64,
pub resolution_bodies: u64,
pub velocity_bodies: u64,
pub damping_bodies: u64,
pub sleep_evaluated: u64,
pub parked_sleep_updates: u64,
pub tree_inserts: u64,
pub tree_removes: u64,
}Expand description
How much work the last PhysicsWorld::step did, stage by stage.
Every counter is a number of items a stage visited, summed over the substeps
of that one call (reset when step starts). They count work, not time, so a
test can assert on them without measuring a clock. step_parallel,
step_with_bridge, the TGS backend and the public substep API add to the
same counters but do not reset them.
With the sleep skip on (PhysicsWorld::set_sleep_skip, the default) a
sleeping body that is at rest and not attached to a joint or distance
constraint is parked: every stage below except sleep_scanned and
parked_sleep_updates leaves it out, and the broad-phase finds its contacts
through a persistent tree instead of rebuilding it. The counters then depend
on the awake bodies only, except those two, which stay one per sleeping body
per step (a check that the parked state was not edited between steps, and
the idle_frames count the snapshot carries).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sleep_scanned: u64Bodies examined at the start of the step to decide which are parked.
parked: u64Bodies parked for this step (not counting ones woken during it).
unparked: u64Parked bodies woken by a contact during the step.
force_field_bodies: u64Bodies the force fields were applied to.
integrated: u64Bodies visited by position integration.
broadphase_primitives: u64Bodies put into the per-substep broad-phase BVH.
broadphase_pairs: u64Candidate pairs the broad-phase handed to the narrow-phase.
broadphase_box_tests: u64Pairs of bodies whose exact boxes the Broadphase::Hybrid broad-phase
compared to find broadphase_pairs (0 with the other broad-phases).
resolution_bodies: u64Bodies tested against the static and SDF colliders.
velocity_bodies: u64Bodies whose velocity was derived from their position change.
damping_bodies: u64Bodies visited by the frame damping.
sleep_evaluated: u64Bodies whose sleep state was evaluated from their velocity.
parked_sleep_updates: u64Parked bodies whose sleep bookkeeping was advanced without evaluation.
tree_inserts: u64Proxies inserted into the parked-body tree.
tree_removes: u64Proxies removed from the parked-body tree.
Trait Implementations§
impl Copy for StageWork
impl Eq for StageWork
impl StructuralPartialEq for StageWork
Auto Trait Implementations§
impl Freeze for StageWork
impl RefUnwindSafe for StageWork
impl Send for StageWork
impl Sync for StageWork
impl Unpin for StageWork
impl UnsafeUnpin for StageWork
impl UnwindSafe for StageWork
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> 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 more