phetsims / density

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

Update `customDensityProperty.rangeProperty` #157

Closed arouinfar closed 1 year ago

arouinfar commented 1 year ago

For #150

On the Mystery screen, the blocks have a customDensityProperty that can be used to directly set the density of the block. The range is currently 0-infinity, which exceeds what is pedagogically useful. Extreme densities can also create difficulties for the physics engine (e.g. very dense blocks are difficult to pick up off the ground).

@DianaTavares @jonathanolson and I discussed today, and decided that we should limit the density to something more realistic. A reasonable minimum would be the density of styrofoam, 150 kg/m^3. A reasonable maximum would be something similar to gold (the highest density listed in the table).

The densest naturally occurring element is osmium, with a density of 22590 kg/m^3. I tested in master with 10L block at 23000 kg/m^3 and the performance seemed reasonable. This slightly exceeds the density of gold, but I think it is pedagogically valuable.

@jonathanolson let's set the range to 150-23000 kg/m^3.

jonathanolson commented 1 year ago

Handled in the commit above. @arouinfar can you verify?

arouinfar commented 1 year ago

Looks good in master, thanks @jonathanolson!