Skip to content

Commit

Permalink
fix: Issue with sparse grid raycast where bounds are errantly zero
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Jul 8, 2024
1 parent e57fd3f commit b60baf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/engine/Collision/Detection/SparseHashGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ export class SparseHashGrid<TObject extends { bounds: BoundingBox }, TProxy exte

update(targets: TObject[]): number {
let updated = 0;
this.bounds.reset();
// FIXME resetting bounds is wrong, if nothing has updated then
// the bounds stay 0
// this.bounds.reset();
for (const target of targets) {
const proxy = this.objectToProxy.get(target);
if (!proxy) {
Expand Down

0 comments on commit b60baf0

Please sign in to comment.