[−][src]Struct myelin_engine::simulation::world::NphysicsWorld
An implementation of World
that uses nphysics
in the background.
Methods
impl NphysicsWorld
[src]
pub fn with_timestep(
timestep: f64,
rotation_translator: Box<dyn NphysicsRotationTranslator>
) -> Self
[src]
timestep: f64,
rotation_translator: Box<dyn NphysicsRotationTranslator>
) -> Self
Instantiates a new empty world
Examples
use myelin_engine::prelude::*; use myelin_engine::simulation::world::{ rotation_translator::NphysicsRotationTranslatorImpl, NphysicsWorld, }; use std::sync::{Arc, RwLock}; let rotation_translator = NphysicsRotationTranslatorImpl::default(); let mut world = NphysicsWorld::with_timestep(1.0, Box::new(rotation_translator));
Trait Implementations
impl World for NphysicsWorld
[src]
fn step(&mut self)
[src]
fn add_body(&mut self, body: PhysicalBody) -> BodyHandle
[src]
#[must_use]
fn remove_body(&mut self, body_handle: BodyHandle) -> Option<PhysicalBody>
[src]
#[must_use]
fn remove_body(&mut self, body_handle: BodyHandle) -> Option<PhysicalBody>#[must_use]
fn body(&self, handle: BodyHandle) -> Option<PhysicalBody>
[src]
#[must_use]
fn body(&self, handle: BodyHandle) -> Option<PhysicalBody>#[must_use]
fn apply_force(&mut self, body_handle: BodyHandle, force: Force) -> Option<()>
[src]
#[must_use]
fn apply_force(&mut self, body_handle: BodyHandle, force: Force) -> Option<()>fn set_simulated_timestep(&mut self, timestep: f64)
[src]
fn is_body_passable(&self, body_handle: BodyHandle) -> bool
[src]
fn bodies_in_area(&self, area: Aabb) -> Vec<BodyHandle>
[src]
fn bodies_in_polygon(&self, area: Polygon) -> Vec<BodyHandle>
[src]
impl Debug for NphysicsWorld
[src]
Auto Trait Implementations
impl !Send for NphysicsWorld
impl !Sync for NphysicsWorld
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
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> 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, 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> 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,