[][src]Struct myelin_engine::simulation::SimulationImpl

pub struct SimulationImpl<T> { /* fields omitted */ }

Implementation of Simulation that uses a physical World in order to apply physics to objects.

Methods

impl<T> SimulationImpl<T> where
    T: AssociatedObjectData, 
[src]

pub fn new(
    world: Box<dyn World>,
    world_interactor_factory_fn: Box<WorldInteractorFactoryFn<T>>,
    instant_wrapper_factory_fn: Box<InstantWrapperFactoryFn>
) -> Self
[src]

Create a new SimulationImpl by injecting a World

Examples

use myelin_engine::prelude::*;
use myelin_engine::simulation::time::InstantWrapperImpl;
use myelin_engine::simulation::world::NphysicsWorld;
use myelin_engine::simulation::SimulationImpl;
use myelin_engine::world_interactor::WorldInteractorImpl;
use std::sync::{Arc, RwLock};
use std::time::Instant;

let world = Box::new(NphysicsWorld::with_timestep(1.0));
let simulation = SimulationImpl::<()>::new(
    world,
    Box::new(|simulation, id| Box::new(WorldInteractorImpl::new(simulation, id))),
    Box::new(|| Box::new(InstantWrapperImpl::new(Instant::now()))),
);

Trait Implementations

impl<T> Simulation<T> for SimulationImpl<T> where
    T: AssociatedObjectData, 
[src]

impl<T> Interactable<T> for SimulationImpl<T> where
    T: AssociatedObjectData, 
[src]

impl<T> Debug for SimulationImpl<T> where
    T: Debug
[src]

Auto Trait Implementations

impl<T> !Send for SimulationImpl<T>

impl<T> !Sync for SimulationImpl<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Downcast for T where
    T: Any