pub struct RapierPhysicsWorld { /* private fields */ }Expand description
Implementation of the PhysicsProvider trait using the Rapier3D physics engine.
Trait Implementations§
Source§impl Default for RapierPhysicsWorld
impl Default for RapierPhysicsWorld
Source§impl PhysicsProvider for RapierPhysicsWorld
impl PhysicsProvider for RapierPhysicsWorld
Source§fn set_gravity(&mut self, gravity: Vec3)
fn set_gravity(&mut self, gravity: Vec3)
Sets the global gravity vector.
Source§fn add_body(&mut self, desc: RigidBodyDesc) -> RigidBodyHandle
fn add_body(&mut self, desc: RigidBodyDesc) -> RigidBodyHandle
Adds a rigid body to the simulation.
Source§fn remove_body(&mut self, handle: RigidBodyHandle)
fn remove_body(&mut self, handle: RigidBodyHandle)
Removes a rigid body from the simulation.
Source§fn add_collider(&mut self, desc: ColliderDesc) -> ColliderHandle
fn add_collider(&mut self, desc: ColliderDesc) -> ColliderHandle
Adds a collider to the simulation.
Source§fn remove_collider(&mut self, handle: ColliderHandle)
fn remove_collider(&mut self, handle: ColliderHandle)
Removes a collider from the simulation.
Source§fn get_body_transform(&self, handle: RigidBodyHandle) -> (Vec3, Quat)
fn get_body_transform(&self, handle: RigidBodyHandle) -> (Vec3, Quat)
Synchronizes the position and rotation of a rigid body.
Source§fn set_body_transform(&mut self, handle: RigidBodyHandle, pos: Vec3, rot: Quat)
fn set_body_transform(&mut self, handle: RigidBodyHandle, pos: Vec3, rot: Quat)
Manually sets the position and rotation of a rigid body.
Source§fn get_all_bodies(&self) -> Vec<RigidBodyHandle>
fn get_all_bodies(&self) -> Vec<RigidBodyHandle>
Returns a list of all active rigid body handles.
Source§fn get_all_colliders(&self) -> Vec<ColliderHandle>
fn get_all_colliders(&self) -> Vec<ColliderHandle>
Returns a list of all active collider handles.
Source§fn update_body_properties(
&mut self,
handle: RigidBodyHandle,
desc: RigidBodyDesc,
)
fn update_body_properties( &mut self, handle: RigidBodyHandle, desc: RigidBodyDesc, )
Updates the properties of an existing rigid body.
Source§fn update_collider_properties(
&mut self,
handle: ColliderHandle,
desc: ColliderDesc,
)
fn update_collider_properties( &mut self, handle: ColliderHandle, desc: ColliderDesc, )
Updates the properties of an existing collider.
Source§fn get_debug_render_data(&self) -> (Vec<Vec3>, Vec<[u32; 2]>)
fn get_debug_render_data(&self) -> (Vec<Vec3>, Vec<[u32; 2]>)
Returns debug rendering lines from the physics engine.
Source§fn cast_ray(&self, ray: &Ray, max_toi: f32, solid: bool) -> Option<RaycastHit>
fn cast_ray(&self, ray: &Ray, max_toi: f32, solid: bool) -> Option<RaycastHit>
Casts a ray into the physics world and returns the closest hit.
Source§fn get_collision_events(&self) -> Vec<CollisionEvent>
fn get_collision_events(&self) -> Vec<CollisionEvent>
Returns the collision events that occurred during the last step.
Source§fn move_character(
&self,
collider: ColliderHandle,
desired_translation: Vec3,
options: &CharacterControllerOptions,
) -> (Vec3, bool)
fn move_character( &self, collider: ColliderHandle, desired_translation: Vec3, options: &CharacterControllerOptions, ) -> (Vec3, bool)
Resolves movement for a kinematic character controller.
Returns the actual translation applied and whether the character is grounded.
Auto Trait Implementations§
impl Freeze for RapierPhysicsWorld
impl !RefUnwindSafe for RapierPhysicsWorld
impl Send for RapierPhysicsWorld
impl Sync for RapierPhysicsWorld
impl Unpin for RapierPhysicsWorld
impl !UnwindSafe for RapierPhysicsWorld
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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<T> Pointable for T
impl<T> Pointable for T
§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.