fix: collision mutex
This commit is contained in:
parent
91d0f481d6
commit
628e0cae48
|
@ -77,7 +77,27 @@ export default class Collider extends Component {
|
|||
intersection.entity.bodies[intersection.i],
|
||||
intersection.other.bodies[intersection.j],
|
||||
];
|
||||
if (!activeIntersections.has(intersection)) {
|
||||
let hasMatchingIntersection = false;
|
||||
for (const activeIntersection of activeIntersections) {
|
||||
if (
|
||||
(
|
||||
activeIntersection.entity === intersection.entity
|
||||
&& activeIntersection.other === intersection.other
|
||||
&& activeIntersection.i === intersection.i
|
||||
&& activeIntersection.j === intersection.j
|
||||
)
|
||||
|| (
|
||||
activeIntersection.entity === intersection.other
|
||||
&& activeIntersection.other === intersection.entity
|
||||
&& activeIntersection.i === intersection.j
|
||||
&& activeIntersection.j === intersection.i
|
||||
)
|
||||
) {
|
||||
hasMatchingIntersection = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasMatchingIntersection) {
|
||||
if (this.$$collisionStart) {
|
||||
const script = this.$$collisionStart.clone();
|
||||
script.context.other = otherEntity;
|
||||
|
|
Loading…
Reference in New Issue
Block a user