phetsims / collision-lab

"Collision Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 4 forks source link

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

Closed brandonLi8 closed 4 years ago

brandonLi8 commented 4 years ago

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?

brandonLi8 commented 4 years ago

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.

arouinfar commented 4 years ago

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.

brandonLi8 commented 4 years ago

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