pub struct World { /* private fields */ }Implementations§
Source§impl World
impl World
pub fn raycast( &self, origin: [f32; 3], direction: [f32; 3], max_distance: f32, filter: Filter, ) -> Option<Hit>
pub fn shape_cast( &self, shape: &Shape, pose: Pose, direction: [f32; 3], max_distance: f32, filter: Filter, ) -> Option<Hit>
pub fn point_overlaps(&self, point: [f32; 3], filter: Filter) -> Vec<ColliderId>
pub fn shape_overlaps( &self, shape: &Shape, pose: Pose, filter: Filter, ) -> Vec<ColliderId>
Source§impl World
impl World
pub fn new(desc: WorldDesc) -> Self
pub fn rate(&self) -> f32
pub fn substeps(&self) -> u32
pub fn dt(&self) -> f32
pub fn steps(&self) -> u64
pub fn time(&self) -> f64
pub fn gravity(&self) -> [f32; 3]
pub fn set_gravity(&mut self, gravity: [f32; 3])
pub fn gravity_at(&self, point: [f32; 3]) -> [f32; 3]
pub fn events(&self) -> &[Event]
pub fn add_source(&mut self, source: Source) -> SourceId
pub fn remove_source(&mut self, id: SourceId) -> bool
pub fn source_mut(&mut self, id: SourceId) -> Option<&mut Source>
pub fn add_body(&mut self, desc: BodyDesc) -> BodyId
pub fn add_collider( &mut self, body: BodyId, desc: ColliderDesc, ) -> Option<ColliderId>
pub fn remove_body(&mut self, body: BodyId) -> bool
pub fn remove_collider(&mut self, collider: ColliderId) -> bool
pub fn bodies(&self) -> Vec<BodyId>
pub fn body(&self, body: BodyId) -> Option<BodyState>
pub fn pose(&self, body: BodyId) -> Option<Pose>
pub fn mass(&self, body: BodyId) -> Option<f32>
pub fn body_of(&self, collider: ColliderId) -> Option<BodyId>
pub fn is_asleep(&self, body: BodyId) -> bool
pub fn set_pose(&mut self, body: BodyId, to: Pose) -> bool
pub fn set_velocity( &mut self, body: BodyId, linear: [f32; 3], angular: [f32; 3], ) -> bool
pub fn apply_impulse(&mut self, body: BodyId, impulse: [f32; 3]) -> bool
pub fn apply_impulse_at( &mut self, body: BodyId, impulse: [f32; 3], point: [f32; 3], ) -> bool
pub fn apply_torque_impulse(&mut self, body: BodyId, impulse: [f32; 3]) -> bool
pub fn add_force(&mut self, body: BodyId, force: [f32; 3]) -> bool
pub fn add_force_at( &mut self, body: BodyId, force: [f32; 3], point: [f32; 3], ) -> bool
pub fn add_torque(&mut self, body: BodyId, torque: [f32; 3]) -> bool
pub fn set_gravity_scale(&mut self, body: BodyId, scale: f32) -> bool
pub fn set_damping(&mut self, body: BodyId, linear: f32, angular: f32) -> bool
pub fn set_ccd(&mut self, body: BodyId, ccd: bool) -> bool
pub fn set_locks(&mut self, body: BodyId, locks: Locks) -> bool
pub fn locks(&self, body: BodyId) -> Option<Locks>
pub fn sleep(&mut self, body: BodyId) -> bool
pub fn wake(&mut self, body: BodyId) -> bool
pub fn set_drive(&mut self, body: BodyId, drive: Option<Drive>) -> bool
pub fn drive(&self, body: BodyId) -> Option<&Drive>
pub fn drive_mut(&mut self, body: BodyId) -> Option<&mut Drive>
pub fn move_to(&mut self, body: BodyId, to: Pose) -> bool
pub fn step(&mut self)
pub fn refresh_queries(&mut self)
pub fn run(&mut self, steps: u32)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for World
impl !RefUnwindSafe for World
impl Send for World
impl Sync for World
impl Unpin for World
impl UnsafeUnpin for World
impl !UnwindSafe for World
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.