[−][src]Struct myelin_engine::simulation::SimulationImpl
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]
world: Box<dyn World>,
world_interactor_factory_fn: Box<WorldInteractorFactoryFn>,
instant_wrapper_factory_fn: Box<InstantWrapperFactoryFn>
) -> Self
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]
fn step(&mut self)
[src]
fn add_object(
&mut self,
object_description: ObjectDescription,
object_behavior: Box<dyn ObjectBehavior>
) -> Object
[src]
&mut self,
object_description: ObjectDescription,
object_behavior: Box<dyn ObjectBehavior>
) -> Object
fn objects(&self) -> Snapshot
[src]
fn set_simulated_timestep(&mut self, timestep: f64)
[src]
fn objects_in_area(&self, area: Aabb) -> Snapshot
[src]
impl Interactable for SimulationImpl
[src]
fn objects_in_area(&self, area: Aabb) -> Snapshot
[src]
fn elapsed_time_in_update(&self) -> Duration
[src]
impl Debug for SimulationImpl
[src]
Auto Trait Implementations
impl !Send for SimulationImpl
impl !Sync for SimulationImpl
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Downcast for T where
T: Any,
T: Any,