pub struct WorldState {
pub positions: Vec<f64>,
pub velocities: Vec<f64>,
pub inverse_masses: Vec<f64>,
}Expand description
Minimal world state passed to PhysicsPipeline::step.
Uses pure f64 arrays (no nalgebra) compatible with GPU buffer uploads.
Fields§
§positions: Vec<f64>Flat position array [x0, y0, z0, x1, y1, z1, ...].
velocities: Vec<f64>Flat velocity array [vx0, vy0, vz0, ...].
inverse_masses: Vec<f64>Inverse masses [inv_m0, inv_m1, ...].
Implementations§
Source§impl WorldState
impl WorldState
Sourcepub fn body_count(&self) -> usize
pub fn body_count(&self) -> usize
Number of bodies in the world state.
Trait Implementations§
Source§impl Clone for WorldState
impl Clone for WorldState
Source§fn clone(&self) -> WorldState
fn clone(&self) -> WorldState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 WorldState
impl Debug for WorldState
Source§impl Default for WorldState
impl Default for WorldState
Source§fn default() -> WorldState
fn default() -> WorldState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorldState
impl RefUnwindSafe for WorldState
impl Send for WorldState
impl Sync for WorldState
impl Unpin for WorldState
impl UnsafeUnpin for WorldState
impl UnwindSafe for WorldState
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<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>
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 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>
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