phetsims/collision-lab

Question: What is the range of the position of the Ball that the user can set

Closed this issue · 3 comments

Currently, the user can change the position of a Ball through the BallValuesPanel by clicking on a number display, which pops up a Keypad, as expected.

However, Ball's have a derived radius from a constant density, meaning their radii are often long decimals. I have it so the current range that the user can type in the Keypad is the dragging range of the ball with the grid off.

image

As you can see, this is a very ugly looking range.

So my question is, what is the range of the Ball that the user can set via the Keypad?

One way this could easily be solved is by using the dragging range of the Ball when the grid is visible, which rounds in to the closest grid. ie.

image
this ball cannot be further dragged leftwards as it would snap to a grid position such that the left side of the ball would be outside the play area.

Rounding in would give a nicer looking range that doesn't have as many decimal places yet would still ensure that the user doesn't type a position that moves the ball outside the play area.

One way this could easily be solved is by using the dragging range of the Ball when the grid is visible, which rounds in to the closest grid.

Great idea @brandonLi8. Let's do this.

Done in the commit above. The ranges are now much nicer looking. Closing.