correction to one way collision code

This commit is contained in:
Juan Linietsky 2017-09-17 10:18:09 -03:00
parent 5886f810c2
commit d22ceeef1b
2 changed files with 4 additions and 4 deletions

View file

@ -580,7 +580,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
ExcludedShapeSW esp; ExcludedShapeSW esp;
esp.local_shape = body_shape; esp.local_shape = body_shape;
esp.against_object = col_obj; esp.against_object = col_obj;
esp.against_shape = against_shape; esp.against_shape_index = shape_idx;
excluded_shape_pairs[excluded_shape_pair_count++] = esp; excluded_shape_pairs[excluded_shape_pair_count++] = esp;
} }
} }
@ -649,7 +649,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
for (int k = 0; k < excluded_shape_pair_count; k++) { for (int k = 0; k < excluded_shape_pair_count; k++) {
if (excluded_shape_pairs[k].local_shape == body_shape && excluded_shape_pairs[k].against_object == col_obj && excluded_shape_pairs[k].against_shape == against_shape) { if (excluded_shape_pairs[k].local_shape == body_shape && excluded_shape_pairs[k].against_object == col_obj && excluded_shape_pairs[k].against_shape_index == shape_idx) {
excluded = true; excluded = true;
break; break;
} }
@ -780,7 +780,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
bool excluded = false; bool excluded = false;
for (int k = 0; k < excluded_shape_pair_count; k++) { for (int k = 0; k < excluded_shape_pair_count; k++) {
if (excluded_shape_pairs[k].local_shape == body_shape && excluded_shape_pairs[k].against_object == col_obj && excluded_shape_pairs[k].against_shape == against_shape) { if (excluded_shape_pairs[k].local_shape == body_shape && excluded_shape_pairs[k].against_object == col_obj && excluded_shape_pairs[k].against_shape_index == shape_idx) {
excluded = true; excluded = true;
break; break;
} }

View file

@ -74,7 +74,7 @@ private:
struct ExcludedShapeSW { struct ExcludedShapeSW {
Shape2DSW *local_shape; Shape2DSW *local_shape;
const CollisionObject2DSW *against_object; const CollisionObject2DSW *against_object;
Shape2DSW *against_shape; int against_shape_index;
}; };
uint64_t elapsed_time[ELAPSED_TIME_MAX]; uint64_t elapsed_time[ELAPSED_TIME_MAX];