@@ -316,41 +316,39 @@ bool GodotBodyPair2D::setup(real_t p_step) {
316
316
return false ;
317
317
}
318
318
319
- if (!prev_collided) {
320
- if (shape_B_ptr->allows_one_way_collision () && A->is_shape_set_as_one_way_collision (shape_A)) {
321
- Vector2 direction = xform_A.columns [1 ].normalized ();
322
- bool valid = false ;
323
- for (int i = 0 ; i < contact_count; i++) {
324
- Contact &c = contacts[i];
325
- if (c.normal .dot (direction) > -CMP_EPSILON) { // Greater (normal inverted).
326
- continue ;
327
- }
328
- valid = true ;
329
- break ;
330
- }
331
- if (!valid) {
332
- collided = false ;
333
- oneway_disabled = true ;
334
- return false ;
319
+ if (shape_B_ptr->allows_one_way_collision () && A->is_shape_set_as_one_way_collision (shape_A)) {
320
+ Vector2 direction = xform_A.columns [1 ].normalized ();
321
+ bool valid = false ;
322
+ for (int i = 0 ; i < contact_count; i++) {
323
+ Contact &c = contacts[i];
324
+ if (c.normal .dot (direction) > -CMP_EPSILON) { // Greater (normal inverted).
325
+ continue ;
335
326
}
327
+ valid = true ;
328
+ break ;
336
329
}
330
+ if (!valid) {
331
+ collided = false ;
332
+ oneway_disabled = true ;
333
+ return false ;
334
+ }
335
+ }
337
336
338
- if (shape_A_ptr->allows_one_way_collision () && B->is_shape_set_as_one_way_collision (shape_B)) {
339
- Vector2 direction = xform_B.columns [1 ].normalized ();
340
- bool valid = false ;
341
- for (int i = 0 ; i < contact_count; i++) {
342
- Contact &c = contacts[i];
343
- if (c.normal .dot (direction) < CMP_EPSILON) { // Less (normal ok).
344
- continue ;
345
- }
346
- valid = true ;
347
- break ;
348
- }
349
- if (!valid) {
350
- collided = false ;
351
- oneway_disabled = true ;
352
- return false ;
337
+ if (shape_A_ptr->allows_one_way_collision () && B->is_shape_set_as_one_way_collision (shape_B)) {
338
+ Vector2 direction = xform_B.columns [1 ].normalized ();
339
+ bool valid = false ;
340
+ for (int i = 0 ; i < contact_count; i++) {
341
+ Contact &c = contacts[i];
342
+ if (c.normal .dot (direction) < CMP_EPSILON) { // Less (normal ok).
343
+ continue ;
353
344
}
345
+ valid = true ;
346
+ break ;
347
+ }
348
+ if (!valid) {
349
+ collided = false ;
350
+ oneway_disabled = true ;
351
+ return false ;
354
352
}
355
353
}
356
354
0 commit comments