Skip to content

Commit

Permalink
No pointer interaction when mouseForce===0
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba committed Dec 27, 2024
1 parent 56193e7 commit ce1c486
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-kings-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"planck": patch
---

No pointer interaction when mouseForce===0
3 changes: 2 additions & 1 deletion testbed/StageTestbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Body } from "../src/dynamics/Body";
import type { AABBValue } from "../src/collision/AABB";
import { Testbed } from "../src/util/Testbed";
import { MouseJoint } from "../src/dynamics/joint/MouseJoint";
import { WorldComponent, WorldDragEnd, WorldDragMove, WorldDragStart, WorldPointerMove } from "./world-view";
import { WorldComponent, WorldDragEnd, WorldDragMove, WorldDragStart } from "./world-view";

const math_PI = Math.PI;

Expand Down Expand Up @@ -157,6 +157,7 @@ export class StageTestbed extends Testbed {

if (this.mouseForce) {
targetBody = body;
} else if (this.mouseForce === 0) {
} else {
mouseJoint = new MouseJoint({ maxForce: 1000 }, mouseGround, body, {
x: point.x,
Expand Down

0 comments on commit ce1c486

Please sign in to comment.