Skip to content

Commit 691e8a8

Browse files
authored
Unbuffer all proxy moves (ported 48e167c) (#53)
* Unbuffer all proxy moves (ported 48e167c) fixes #52 * Replace public; remove number type
1 parent fc519b5 commit 691e8a8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/src/collision/b2_broad_phase.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ export class b2BroadPhase<T> {
216216
}
217217

218218
private UnBufferMove(proxy: b2TreeNode<T>): void {
219-
const i = this.m_moveBuffer.indexOf(proxy);
220-
this.m_moveBuffer[i] = null;
221-
}
219+
for (let i = 0; i < this.m_moveCount; ++i) {
220+
if (this.m_moveBuffer[i] === proxy) {
221+
this.m_moveBuffer[i] = null;
222+
}
223+
}
224+
}
222225
}

0 commit comments

Comments
 (0)