Skip to main content

StageWork

Struct StageWork 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§sleep_scanned: u64

Bodies examined at the start of the step to decide which are parked.

§parked: u64

Bodies parked for this step (not counting ones woken during it).

§unparked: u64

Parked bodies woken by a contact during the step.

§force_field_bodies: u64

Bodies the force fields were applied to.

§integrated: u64

Bodies visited by position integration.

§broadphase_primitives: u64

Bodies put into the per-substep broad-phase BVH.

§broadphase_pairs: u64

Candidate pairs the broad-phase handed to the narrow-phase.

§broadphase_box_tests: u64

Pairs of bodies whose exact boxes the Broadphase::Hybrid broad-phase compared to find broadphase_pairs (0 with the other broad-phases).

§resolution_bodies: u64

Bodies tested against the static and SDF colliders.

§velocity_bodies: u64

Bodies whose velocity was derived from their position change.

§damping_bodies: u64

Bodies visited by the frame damping.

§sleep_evaluated: u64

Bodies whose sleep state was evaluated from their velocity.

§parked_sleep_updates: u64

Parked bodies whose sleep bookkeeping was advanced without evaluation.

§tree_inserts: u64

Proxies inserted into the parked-body tree.

§tree_removes: u64

Proxies removed from the parked-body tree.

Trait Implementations§

Source§

impl Clone for StageWork

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StageWork

Source§

impl Debug for StageWork

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StageWork

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for StageWork

Source§

impl PartialEq for StageWork

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StageWork

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.