diff --git a/js/common/model/Mass.ts b/js/common/model/Mass.ts index 387d5db7..a6fff454 100644 --- a/js/common/model/Mass.ts +++ b/js/common/model/Mass.ts @@ -532,13 +532,6 @@ export default abstract class Mass extends PhetioObject { this.engine.updatePointerConstraint( this.body, position ); } - /** - * Updates a current drag with a new 2d (x,y) model delta. - */ - public updateDragFromDelta( delta: Vector2 ): void { - this.engine.updatePointerConstraintFromDelta( this.body, delta ); - } - /** * Ends a physics model engine drag. */ diff --git a/js/common/model/PhysicsEngine.ts b/js/common/model/PhysicsEngine.ts index b5d5ae59..bdd978f4 100644 --- a/js/common/model/PhysicsEngine.ts +++ b/js/common/model/PhysicsEngine.ts @@ -401,25 +401,6 @@ export default class PhysicsEngine { pointerConstraint.bodyB.wakeUp(); } - /** - * Updates a pointer constraint so that the body will move by the provided delta value. This can be useful because - * pointerConstraints can be initialized with an offset from, the body origin. - */ - public updatePointerConstraintFromDelta( body: PhysicsEngineBody, deltaVector: Vector2 ): void { - const delta = PhysicsEngine.vectorToP2( deltaVector ); - - const pointerConstraint = this.pointerConstraintMap[ body.id ]; - assert && assert( pointerConstraint, `pointer constraint expected for physics body #${body.id}` ); - - // @ts-expect-error it should have pivotA... - pointerConstraint.pivotA[ 0 ] += delta[ 0 ]; - // @ts-expect-error it should have pivotA... - pointerConstraint.pivotA[ 1 ] += delta[ 1 ]; - - pointerConstraint.bodyA.wakeUp(); - pointerConstraint.bodyB.wakeUp(); - } - /** * Removes a pointer constraint. */ diff --git a/js/common/view/MassView.ts b/js/common/view/MassView.ts index 5771ffaa..e747600d 100644 --- a/js/common/view/MassView.ts +++ b/js/common/view/MassView.ts @@ -138,7 +138,7 @@ export default abstract class MassView extends Disposable { transform: INVERT_Y_TRANSFORM, drag: ( event, listener ) => { mass.grabDragUsageTracker.shouldShowDragCue = false; - mass.updateDragFromDelta( listener.modelDelta ); // Update based on deltas instead of absolute, fixing, https://github.com/phetsims/density-buoyancy-common/issues/367 + mass.updateDrag( mass.matrix.translation.add( listener.modelDelta ) ); }, tandem: Tandem.OPT_OUT } );