Skip to content

Commit

Permalink
fix: Hitbox cannot determine whether the ball hit the ground precisely
Browse files Browse the repository at this point in the history
  • Loading branch information
NriotHrreion committed Oct 27, 2024
1 parent 7a3c9ca commit 2f0f2f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/simulator/hitboxes/groundHitbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class GroundHitbox extends Hitbox implements IGroundHitbox {
if(hitbox instanceof RoundHitbox) {
const distance = this.anchor.y - hitbox.anchor.y;

if(distance <= hitbox.radius) {
if(distance <= hitbox.radius * 2) {
this._onHit.fire({ obj, depth: hitbox.radius - distance });
}
} else if(obj instanceof Block) { // special type of ConvexHitbox
Expand Down

0 comments on commit 2f0f2f1

Please sign in to comment.