pub struct PySnapshot {
pub time: f64,
pub kinetic_energy: f64,
pub potential_energy: f64,
pub total_energy: f64,
pub linear_momentum: f64,
pub angular_momentum: f64,
pub contact_count: usize,
pub awake_count: usize,
pub sleeping_count: usize,
pub step_ms: f64,
}Expand description
A snapshot of global physics state at one time step.
Fields§
§time: f64Simulation time (seconds).
kinetic_energy: f64Total kinetic energy (J).
potential_energy: f64Total potential energy (J).
total_energy: f64Total energy (KE + PE).
linear_momentum: f64Linear momentum magnitude |p|.
angular_momentum: f64Angular momentum magnitude |L|.
contact_count: usizeNumber of active contacts.
awake_count: usizeNumber of awake bodies.
sleeping_count: usizeNumber of sleeping bodies.
step_ms: f64Step wall-clock time in milliseconds.
Implementations§
Source§impl PySnapshot
impl PySnapshot
Sourcepub fn compute_total(&mut self)
pub fn compute_total(&mut self)
Compute the total energy.
Trait Implementations§
Source§impl Clone for PySnapshot
impl Clone for PySnapshot
Source§fn clone(&self) -> PySnapshot
fn clone(&self) -> PySnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PySnapshot
impl Debug for PySnapshot
Source§impl Default for PySnapshot
impl Default for PySnapshot
Source§impl<'de> Deserialize<'de> for PySnapshot
impl<'de> Deserialize<'de> for PySnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PySnapshot
impl RefUnwindSafe for PySnapshot
impl Send for PySnapshot
impl Sync for PySnapshot
impl Unpin for PySnapshot
impl UnsafeUnpin for PySnapshot
impl UnwindSafe for PySnapshot
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.