phetsims / gravity-and-orbits

"Gravity And Orbits" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
12 stars 6 forks source link

Does `massProperty` need a range? #445

Closed arouinfar closed 2 years ago

arouinfar commented 2 years ago

During #440 I noticed that massProperty doesn't have a range. I'm not sure if this will cause issues with the new data-entry functionality of Studio, so I'm wondering if we should impose a range. If we do need a massProperty.rangeProperty, is it reasonable to match the range to what is used for the sliders -- 0.5x-2.0x the default value?

samreid commented 2 years ago

Good catch. This sim has a constraint that the Properties are "rewindable" for when you restore initial conditions. The rewindable nature is currently incompatible with NumberProperty, which is the part of the code that manages the range. Adding range behavior to a new subtype of RewindableProperty seems prohibitively expensive. The behavior in studio is that you can enter any number, and the slider will just go to the extremum if out of range. Negative mass does crash the sim.

arouinfar commented 2 years ago

Thanks for the explanation @samreid. Negative masses do not seem reasonable, so I think we can continue without a range.