File tree 4 files changed +22
-4
lines changed
geometry/broad_phase_multi_sap
4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 59
59
run : cd crates/rapier_testbed2d; cargo check --verbose --features parallel;
60
60
- name : Check rapier_testbed3d --features parallel
61
61
run : cd crates/rapier_testbed3d; cargo check --verbose --features parallel;
62
+ - name : Check rapier_testbed2d --features enhanced-determinism
63
+ run : cd crates/rapier2d; cargo check --verbose --features enhanced-determinism;
64
+ - name : Check rapier_testbed3d --features enhanced-determinism
65
+ run : cd crates/rapier3d; cargo check --verbose --features enhanced-determinism;
62
66
- name : Check rapier-examples-2d
63
67
run : cargo check -j 1 --verbose -p rapier-examples-2d;
64
68
- name : Check rapier-examples-3d
Original file line number Diff line number Diff line change @@ -231,7 +231,12 @@ impl BroadPhaseMultiSap {
231
231
* Actually remove the colliders proxies.
232
232
*/
233
233
for removed in removed_colliders {
234
- if let Some ( proxy_id) = self . colliders_proxy_ids . remove ( removed) {
234
+ #[ cfg( feature = "enhanced-determinism" ) ]
235
+ let proxy_id = self . colliders_proxy_ids . swap_remove ( removed) ;
236
+ #[ cfg( not( feature = "enhanced-determinism" ) ) ]
237
+ let proxy_id = self . colliders_proxy_ids . remove ( removed) ;
238
+
239
+ if let Some ( proxy_id) = proxy_id {
235
240
if proxy_id != crate :: INVALID_U32 {
236
241
self . proxies . remove ( proxy_id) ;
237
242
}
Original file line number Diff line number Diff line change @@ -356,6 +356,9 @@ impl SAPLayer {
356
356
357
357
// Check if we can actually delete this region.
358
358
if !region. contains_subproper_proxies ( ) {
359
+ #[ cfg( feature = "enhanced-determinism" ) ]
360
+ let region_id = region_id. swap_remove ( ) ;
361
+ #[ cfg( not( feature = "enhanced-determinism" ) ) ]
359
362
let region_id = region_id. remove ( ) ;
360
363
361
364
// We can delete this region. So we need to tell the larger
Original file line number Diff line number Diff line change @@ -426,11 +426,17 @@ impl PhysicsPipeline {
426
426
427
427
// Apply some of delayed wake-ups.
428
428
self . counters . stages . user_changes . start ( ) ;
429
- for handle in impulse_joints
429
+ #[ cfg( feature = "enhanced-determinism" ) ]
430
+ let impulse_joints_iterator = impulse_joints
431
+ . to_wake_up
432
+ . drain ( ..)
433
+ . chain ( multibody_joints. to_wake_up . drain ( ..) ) ;
434
+ #[ cfg( not( feature = "enhanced-determinism" ) ) ]
435
+ let impulse_joints_iterator = impulse_joints
430
436
. to_wake_up
431
437
. drain ( )
432
- . chain ( multibody_joints. to_wake_up . drain ( ) )
433
- {
438
+ . chain ( multibody_joints. to_wake_up . drain ( ) ) ;
439
+ for handle in impulse_joints_iterator {
434
440
islands. wake_up ( bodies, handle. 0 , true ) ;
435
441
}
436
442
You can’t perform that action at this time.
0 commit comments