7777 /// See [`PhysicsSet`] for a description of these systems.
7878 pub fn get_systems ( set : PhysicsSet ) -> SystemConfigs {
7979 match set {
80+ PhysicsSet :: EveryFrame => (
81+ systems:: collect_collider_hierarchy_changes,
82+ apply_deferred,
83+ systems:: sync_removals,
84+ ) . chain ( )
85+ . into_configs ( ) ,
8086 PhysicsSet :: SyncBackend => (
8187 // Run the character controller before the manual transform propagation.
8288 systems:: update_character_controls,
@@ -87,39 +93,17 @@ where
8793 )
8894 . chain ( )
8995 . in_set ( RapierTransformPropagateSet ) ,
90- <<<<<<< HEAD
91- =======
92- systems:: init_async_colliders . after( RapierTransformPropagateSet ) ,
93- systems:: collect_collider_hierarchy_changes
94- . before( systems:: apply_collider_user_changes ) ,
95- apply_deferred. after ( systems:: collect_collider_hierarchy_changes ) ,
96- systems:: apply_scale . after( systems:: init_async_colliders ) ,
97- systems:: apply_collider_user_changes . after( systems:: apply_scale ) ,
98- systems:: apply_rigid_body_user_changes . after( systems:: apply_collider_user_changes ) ,
99- systems:: apply_joint_user_changes . after( systems:: apply_rigid_body_user_changes ) ,
100- systems:: init_rigid_bodies . after( systems:: apply_joint_user_changes ) ,
101- systems:: init_colliders
102- . after( systems:: init_rigid_bodies )
103- . after ( systems:: init_async_colliders ) ,
104- systems:: init_joints . after( systems:: init_colliders ) ,
105- systems:: apply_initial_rigid_body_impulses
106- . after( systems:: init_colliders )
107- . ambiguous_with ( systems:: init_joints ) ,
108- systems:: sync_removals
109- . after( systems:: init_joints )
110- . after ( systems:: apply_initial_rigid_body_impulses ) ,
111- >>>>>>> 9246295 ( Formatting , etc. )
11296 #[ cfg ( all ( feature = "dim3" , feature = "async-collider" ) ) ]
11397 systems:: init_async_scene_colliders. after ( bevy:: scene:: scene_spawner_system) ,
11498 #[ cfg ( all ( feature = "dim3" , feature = "async-collider" ) ) ]
11599 systems:: init_async_colliders,
116100 systems:: init_rigid_bodies,
117101 systems:: init_colliders,
118102 systems:: init_joints,
119- systems:: sync_removals,
120103 systems:: collect_collider_hierarchy_changes,
121- // Run this here so the folowwing systems do not have a 1 frame delay.
104+ // Run this here so the following systems do not have a 1 frame delay.
122105 apply_deferred,
106+ systems:: sync_removals,
123107 systems:: apply_scale,
124108 systems:: apply_collider_user_changes,
125109 systems:: apply_rigid_body_user_changes,
@@ -182,6 +166,9 @@ pub enum PhysicsSet {
182166 /// components and the [`GlobalTransform`] component.
183167 /// These systems typically run immediately after [`PhysicsSet::StepSimulation`].
184168 Writeback ,
169+ /// The systems responsible for responding to state like `Events` that get
170+ /// cleared every 2 main schedule runs.
171+ EveryFrame ,
185172}
186173
187174impl < PhysicsHooks > Plugin for RapierPhysicsPlugin < PhysicsHooks >
@@ -232,6 +219,10 @@ where
232219
233220 // Add each set as necessary
234221 if self . default_system_setup {
222+ app. configure_sets (
223+ PostUpdate
224+ PhysicsSet :: EveryFrame ,
225+ ) ;
235226 app. configure_sets (
236227 self . schedule . clone ( ) ,
237228 (
@@ -244,7 +235,7 @@ where
244235 ) ;
245236
246237 // These *must* be in the main schedule currently so that they do not miss events.
247- app. add_systems ( PostUpdate , ( systems :: sync_removals , ) ) ;
238+ app. add_systems ( PostUpdate , Self :: get_systems ( PhysicsSet :: EveryFrame ) . in_set ( PhysicsSet :: EveryFrame ) ) ;
248239
249240 app. add_systems (
250241 self . schedule . clone ( ) ,
0 commit comments