pub struct Physics<S: PhysicsSpace> { /* private fields */ }Implementations§
Source§impl<S> Physics<S>where
S: Homogeneous + PhysicsSpace + Copy,
S::Vector: VectorOps + Default,
S::Point: Sub<Output = S::Vector>,
impl<S> Physics<S>where
S: Homogeneous + PhysicsSpace + Copy,
S::Vector: VectorOps + Default,
S::Point: Sub<Output = S::Vector>,
pub fn world(&self) -> &World<S>
pub fn narrowphase_mut(&mut self) -> &mut Narrowphase<S>
pub fn set_solver_iterations(&mut self, iterations: usize)
Sourcepub fn set_grab_hold(&mut self, hold: GrabHold)
pub fn set_grab_hold(&mut self, hold: GrabHold)
Has no effect on a domain built without a grab.
pub fn set_gravity( &mut self, gravity: Option<S::Vector>, ) -> Result<(), EditError>
pub fn set_solver_tolerance(&mut self, tolerance: f32) -> Result<(), EditError>
pub fn body(&self, entity: Entity) -> Option<BodyId>
pub fn entity(&self, body: BodyId) -> Option<Entity>
pub fn set_velocity( &mut self, entity: Entity, velocity: S::Vector, angular_velocity: S::AngVel, ) -> Result<(), EditError>
pub fn set_restitution( &mut self, entity: Entity, restitution: f32, ) -> Result<(), EditError>
pub fn set_collision_filter( &mut self, entity: Entity, group: u32, mask: u32, ) -> Result<(), EditError>
pub fn set_mass_properties( &mut self, entity: Entity, mass: f32, inertia: S::Inertia, ) -> Result<(), EditError>
pub fn set_collider( &mut self, entity: Entity, collider: Collider, inertia: S::Inertia, ) -> Result<(), EditError>
pub fn sleep_body(&mut self, entity: Entity) -> Result<(), EditError>
pub fn wake_body(&mut self, entity: Entity) -> Result<(), EditError>
pub fn is_held(&self, entity: Entity) -> bool
pub fn held_anchor(&self, entity: Entity) -> Option<S::Point>
pub fn throw( &mut self, entity: Entity, velocity: S::Vector, ) -> Result<(), EditError>
Sourcepub fn released_anchor(&self, entity: Entity) -> Option<S::Point>
pub fn released_anchor(&self, entity: Entity) -> Option<S::Point>
The grab point of the body released last, moved with the body since.
pub fn despawn(&mut self, entity: Entity) -> Option<BodyId>
Trait Implementations§
Source§impl<S> Facility<S> for Physics<S>
impl<S> Facility<S> for Physics<S>
fn name(&self) -> &'static str
fn bind(&mut self, scene: SceneId, _owner: Owner)
fn step( &mut self, poses: &mut Store<Pose<S>>, step: Step, _owner: Owner, ) -> Result<(), DomainError>
fn synchronize(&mut self, poses: &mut Store<Pose<S>>, _owner: Owner)
fn set_pose( &mut self, entity: Entity, pose: Pose<S>, poses: &mut Store<Pose<S>>, _owner: Owner, ) -> Option<Result<(), DomainError>>
fn move_to( &mut self, entity: Entity, point: S::Point, poses: &mut Store<Pose<S>>, _owner: Owner, ) -> Option<Result<(), DomainError>>
fn snapshot(&self, _owner: Owner) -> Box<dyn Any + Send>
Source§fn check_restore(
&self,
from: &(dyn Any + Send),
_owner: Owner,
) -> Result<(), RestoreError>
fn check_restore( &self, from: &(dyn Any + Send), _owner: Owner, ) -> Result<(), RestoreError>
Refuses whatever
restore would refuse, changing nothing; the session calls it on every facility before the first one restores.fn restore( &mut self, from: &(dyn Any + Send), _owner: Owner, ) -> Result<(), RestoreError>
fn release(&mut self, entity: Entity, _owner: Owner)
Auto Trait Implementations§
impl<S> Freeze for Physics<S>
impl<S> !RefUnwindSafe for Physics<S>
impl<S> Send for Physics<S>
impl<S> Sync for Physics<S>
impl<S> Unpin for Physics<S>
impl<S> UnsafeUnpin for Physics<S>
impl<S> !UnwindSafe for Physics<S>
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