[−][src]Struct torophy::space::Space
Implementations
impl Space
[src]
pub fn new(width: u32, height: u32) -> Space
[src]
pub fn with_optimization_cell_size(self, cell_size: f32) -> Space
[src]
A convenient method to modify optionally the internal cell_size during the Space building. This cell_size value is used as a heuristic for performance reasons when collisions are involved. A value between 1 or 2 times the average size of the shapes works fine.
pub fn bounds(&self) -> &Bounds
[src]
pub fn bodies(&self) -> Iter<Body>
[src]
pub fn bodies_mut(&mut self) -> IterMut<Body>
[src]
pub fn add(&mut self, body: Body)
[src]
pub fn update(&mut self, duration: Duration)
[src]
Main function that performs a physics step over the bodies in the space. The duration paramenter is the integration time value. It represents the physics interval that will be emulated. High 'duration' value will needs low to call this funcion but reduce the physics accuracy resolution. Less 'duration' value will needs more calls to update but improve the physics accuracy resolution.
Auto Trait Implementations
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnwindSafe for Space
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,