phetsims / build-an-atom

"Build an Atom" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/build-an-atom
GNU General Public License v3.0
11 stars 10 forks source link

Particles automatically make pyramid to the right of the bucket #210

Closed KatieWoe closed 4 years ago

KatieWoe commented 4 years ago

Test device Dell Operating System Win 10 Browser Firefox Problem description For https://github.com/phetsims/QA/issues/482 The subatomic particles in the buckets seem to default to a pyramid position to the right of the bucket. If you move particles not in that position they automatically move there, and you can't move them back. In the published sim the particles position in the bucket doesn't matter as long as something is under them. (This is a bit hard to describe. Let me know if you need more info.)

Visuals defaultpyramid

Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: ‪Build an Atom‬ URL: https://phet-dev.colorado.edu/modules-testing/build-an-atom/phet/build-an-atom_all_phet.html Version: 1.7.0-dev.0 2020-02-20 20:09:34 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0 Language: en-US Window: 1536x750 Pixel Ratio: 2.5/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 Vendor: Mozilla (Mozilla) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 32767x32767 OES_texture_float: true Dependencies JSON: {}
KatieWoe commented 4 years ago

Happening in other sims with buckets of particles, such as Isotopes and Atomic Mass

jbphet commented 4 years ago

@Denz1994 - this behavior was introduced in https://github.com/phetsims/phetcommon/commit/c60cdfc21d5244ea23435f761bfef1b11bbeee3e. I looked through and figured out was was going on, but I think it'd be best if you fixed it. Let me know if you'd like a hand with it.

Denz1994 commented 4 years ago

During refactoring, I removed an argument out of getNearestOpenPosition(position). This means the desitnationProperty was not being used when iterating over the openPositions closest to the destinationProperty. A different Vector2 was being used.

The correct destinationProperty.value was reintroduced and this was fixed in BAA and IAM. Closing this one.