pub struct PhysicsSystem { /* private fields */ }Expand description
Rigid-body simulation behavior. Constructed internally by World::start
from the world’s PhysicsConfig; never a declarable asset.
new steps the simulation on the calling thread; a
host lends it threads through with_fanout.
Implementations§
Source§impl PhysicsSystem
impl PhysicsSystem
Sourcepub fn new(config: PhysicsConfig) -> Self
pub fn new(config: PhysicsConfig) -> Self
Build the simulation from the world’s PhysicsConfig (floor / terrain).
Bodies and colliders are added from the ECS in System::init.
Sourcepub fn with_fanout(self, fanout: Box<dyn PhysicsFanout>) -> Self
pub fn with_fanout(self, fanout: Box<dyn PhysicsFanout>) -> Self
Run the step’s independent work through fanout rather than on the
calling thread. What a step hands out and the order its results load
back in are the simulation’s; a fan-out decides only where the work
runs, so this cannot change the state a tick lands on.
Trait Implementations§
Source§impl Debug for PhysicsSystem
impl Debug for PhysicsSystem
Source§impl System for PhysicsSystem
impl System for PhysicsSystem
Source§fn init(&mut self, ctx: &mut PipelineContext<'_>)
fn init(&mut self, ctx: &mut PipelineContext<'_>)
Run once at
World::start, before the first step.Source§fn step(&mut self, ctx: &mut PipelineContext<'_>) -> StepResult
fn step(&mut self, ctx: &mut PipelineContext<'_>) -> StepResult
Run once per tick.
Source§fn access(&self) -> Access
fn access(&self) -> Access
The data
step may touch, consulted once when the schedule is built
(after init, so a data-dependent system can compute it from its
compiled state). The default claims everything: an undeclared system is
ordered against all others and never runs concurrently, which is always
safe. Declaring narrower access is what admits a system to shared waves
and to debug-build access validation.Auto Trait Implementations§
impl !Freeze for PhysicsSystem
impl !RefUnwindSafe for PhysicsSystem
impl !Sync for PhysicsSystem
impl !UnwindSafe for PhysicsSystem
impl Send for PhysicsSystem
impl Unpin for PhysicsSystem
impl UnsafeUnpin for PhysicsSystem
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