Currently, BallNode creates a DragListener to allow the user to drag the ball. It does so with the Ball's positionProperty. However, in Ball.js, there is both
// @public position of the ball for DragListener
this.positionProperty = new Vector2Property( position );
and
// @public (read-only) momentumProperty - Property of the position of the ball in m
this.positionDerivedProperty = new DerivedProperty( [ this.positionXProperty, this.positionYProperty ],
( positionX, positionY ) => new Vector2( positionX, positionY ) );
which seems redundant. This can be removed by implementing the DragListener in terms of view Properties, similar to how it's done in Vector Addition. This applies also to the Velocity DragListener as well.
For now, I'm going to go ahead and implement this change.
Currently,
BallNode
creates aDragListener
to allow the user to drag the ball. It does so with the Ball'spositionProperty
. However, inBall.js
, there is bothand
which seems redundant. This can be removed by implementing the
DragListener
in terms of view Properties, similar to how it's done inVector Addition
. This applies also to the VelocityDragListener
as well.For now, I'm going to go ahead and implement this change.