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

pub struct SimulationImpl { /* fields omitted */ }

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

Methods

impl SimulationImpl[src]

pub fn new(
    world: Box<dyn World>,
    world_interactor_factory_fn: Box<WorldInteractorFactoryFn>,
    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::{
    rotation_translator::NphysicsRotationTranslatorImpl, NphysicsWorld,
};
use myelin_engine::simulation::SimulationImpl;
use myelin_engine::world_interactor::WorldInteractorImpl;
use std::sync::{Arc, RwLock};
use std::time::Instant;

let rotation_translator = NphysicsRotationTranslatorImpl::default();
let world = Box::new(NphysicsWorld::with_timestep(
    1.0,
    Box::new(rotation_translator),
));
let simulation = SimulationImpl::new(
    world,
    Box::new(|simulation| Box::new(WorldInteractorImpl::new(simulation))),
    Box::new(|| Box::new(InstantWrapperImpl::new(Instant::now()))),
);

Trait Implementations

impl Simulation for SimulationImpl[src]

impl Interactable for SimulationImpl[src]

impl Debug for SimulationImpl[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Same for T

type Output = T

Should always be Self

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

impl<T> Downcast for T where
    T: Any