pub fn register_physics_systems<N, P>(dispatcher_builder: &mut DispatcherBuilder)
where
    N: RealField,
    P: Position<N>,
{
    // add SyncBodiesToPhysicsSystem first since we have to start with bodies;
    // colliders can exist without a body but in most cases have a body parent
    dispatcher_builder.add(
        SyncBodiesToPhysicsSystem::<N, P>::default(),
        "sync_bodies_to_physics_system",
        &[],
    );

    // add SyncCollidersToPhysicsSystem next with SyncBodiesToPhysicsSystem as its
    // dependency
    dispatcher_builder.add(
        SyncCollidersToPhysicsSystem::<N, P>::default(),
        "sync_colliders_to_physics_system",
        &["sync_bodies_to_physics_system"],
    );

    // add SyncParametersToPhysicsSystem; this System can be added at any point in
    // time as it merely synchronizes the simulation parameters of the world,
    // thus it has no other dependencies.
    dispatcher_builder.add(
        SyncParametersToPhysicsSystem::<N>::default(),
        "sync_parameters_to_physics_system",
        &[],
    );

    // add PhysicsStepperSystem after all other Systems that write data to the
    // nphysics DefaultMechanicalWorld and has to depend on them; this System is
    // used to progress the nphysics DefaultMechanicalWorld for all existing
    // objects
    dispatcher_builder.add(
        PhysicsStepperSystem::<N>::default(),
        "physics_stepper_system",
        &[
            "sync_bodies_to_physics_system",
            "sync_colliders_to_physics_system",
            "sync_parameters_to_physics_system",
        ],
    );

    // add SyncBodiesFromPhysicsSystem last as it handles the
    // synchronisation between nphysics DefaultMechanicalWorld bodies and the
    // Position components; this depends on the PhysicsStepperSystem
    dispatcher_builder.add(
        SyncBodiesFromPhysicsSystem::<N, P>::default(),
        "sync_bodies_from_physics_system",
        &["physics_stepper_system"],
    );
}
/// Convenience function for registering all required physics related `System`s
/// to the given `DispatcherBuilder`. This also serves as a blueprint on how
///// to properly set up the `System`s and have them depend on each other.
Convenience function for registering all required physics related `System`s
to the given `DispatcherBuilder`. This also serves as a blueprint on how
to properly set up the `System`s and have them depend on each other.
Convenience function for registering all required physics related ` System ` s to the given ` DispatcherBuilder ` . This also serves as a blueprint on how to properly set up the ` System ` s and have them depend on each other .
pub fn register_physics_systems<N, P>(dispatcher_builder: &mut DispatcherBuilder)
where
    N: RealField,
    P: Position<N>,
{
    // add SyncBodiesToPhysicsSystem first since we have to start with bodies;
    // colliders can exist without a body but in most cases have a body parent
    dispatcher_builder.add(
        SyncBodiesToPhysicsSystem::<N, P>::default(),
        "sync_bodies_to_physics_system",
        &[],
    );
    // add SyncCollidersToPhysicsSystem next with SyncBodiesToPhysicsSystem as its
    // dependency
    dispatcher_builder.add(
        SyncCollidersToPhysicsSystem::<N, P>::default(),
        "sync_colliders_to_physics_system",
        &["sync_bodies_to_physics_system"],
    );
    // add SyncParametersToPhysicsSystem; this System can be added at any point in
    // time as it merely synchronizes the simulation parameters of the world,
    // thus it has no other dependencies.
    dispatcher_builder.add(
        SyncParametersToPhysicsSystem::<N>::default(),
        "sync_parameters_to_physics_system",
        &[],
    );
    // add PhysicsStepperSystem after all other Systems that write data to the
    // nphysics DefaultMechanicalWorld and has to depend on them; this System is
    // used to progress the nphysics DefaultMechanicalWorld for all existing
    // objects
    dispatcher_builder.add(
        PhysicsStepperSystem::<N>::default(),
        "physics_stepper_system",
        &[
            "sync_bodies_to_physics_system",
            "sync_colliders_to_physics_system",
            "sync_parameters_to_physics_system",
        ],
    );
    // add SyncBodiesFromPhysicsSystem last as it handles the
    // synchronisation between nphysics DefaultMechanicalWorld bodies and the
    // Position components; this depends on the PhysicsStepperSystem
    dispatcher_builder.add(
        SyncBodiesFromPhysicsSystem::<N, P>::default(),
        "sync_bodies_from_physics_system",
        &["physics_stepper_system"],
    );
}
pub fn register_physics_systems < N , P > ( dispatcher_builder : & mut DispatcherBuilder ) where N : RealField , P : Position < N > , { // add SyncBodiesToPhysicsSystem first since we have to start with bodies; // colliders can exist without a body but in most cases have a body parent dispatcher_builder . add ( SyncBodiesToPhysicsSystem :: < N , P > :: default ( ) , " " , & [ ] , ) ; // add SyncCollidersToPhysicsSystem next with SyncBodiesToPhysicsSystem as its // dependency dispatcher_builder . add ( SyncCollidersToPhysicsSystem :: < N , P > :: default ( ) , " " , & [ " " ] , ) ; // add SyncParametersToPhysicsSystem; this System can be added at any point in // time as it merely synchronizes the simulation parameters of the world, // thus it has no other dependencies. dispatcher_builder . add ( SyncParametersToPhysicsSystem :: < N > :: default ( ) , " " , & [ ] , ) ; // add PhysicsStepperSystem after all other Systems that write data to the // nphysics DefaultMechanicalWorld and has to depend on them; this System is // used to progress the nphysics DefaultMechanicalWorld for all existing // objects dispatcher_builder . add ( PhysicsStepperSystem :: < N > :: default ( ) , " " , & [ " " , " " , " " , ] , ) ; // add SyncBodiesFromPhysicsSystem last as it handles the // synchronisation between nphysics DefaultMechanicalWorld bodies and the // Position components; this depends on the PhysicsStepperSystem dispatcher_builder . add ( SyncBodiesFromPhysicsSystem :: < N , P > :: default ( ) , " " , & [ " " ] , ) ; }
Convenience function for registering all required physics related `System`s
to the given `DispatcherBuilder`.
Convenience function for registering all required physics related ` System ` s to the given ` DispatcherBuilder ` .
dispatcher_builder
&mut DispatcherBuilder