Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atoms float in the bucket #112

Closed
KatieWoe opened this issue Nov 21, 2019 · 8 comments
Closed

Atoms float in the bucket #112

KatieWoe opened this issue Nov 21, 2019 · 8 comments

Comments

@KatieWoe
Copy link
Contributor

Test device
Dell
Operating System
Win 10
Browser
Chrome
Problem description
For phetsims/qa#459
When atoms in a bucket are taken from the bottom layer the atoms above it do not fall, leaving them floating in mid air.
Steps to reproduce

  1. Go to the last screen (occurs on any, but this is easier)
  2. Pick a bucket with two layers
  3. Remove the bottom layer of atoms and put them in the play area.

Visuals
FloatH

Troubleshooting information:

!!!!! DO NOT EDIT !!!!!
Name: ‪Build a Molecule‬
URL: https://phet-dev.colorado.edu/html/build-a-molecule/0.0.0-dev.23/phet/build-a-molecule_all_phet.html
Version: 0.0.0-dev.23 2019-11-20 23:29:39 UTC
Features missing: touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
Language: en-US
Window: 1536x722
Pixel Ratio: 2.5/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
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: {}

@Denz1994
Copy link
Contributor

SphereBucket.removeParticle(particle, skipLayout) indicates that its second argument should determine whether the layout is handled automatically. Currently, this is set to false and layout is handled by BAM code.

This should be refactored, but it requires the atom.destinationProperty be updated accordingly.

Denz1994 added a commit that referenced this issue Apr 8, 2020
@Denz1994
Copy link
Contributor

Denz1994 commented Apr 8, 2020

This can be fixed by adjusting the skipLayout parameter from above. Also, the Atom2.isSeparatingProperty can be removed because it was restricting stepping the Atom to update the position property based on its destination property.

@KatieWoe Can you confirm that the atoms don't float in the buckets anymore? Also, the remaining atoms should fill the space that a removed/dragged atom was occupying. This dev version can be checked.

@KatieWoe
Copy link
Contributor Author

KatieWoe commented Apr 8, 2020

The floating issue seems fixed. I did notice some other odd behavior of the remaining atoms in bucket though. Sometimes one will jump to a higher position, move to the side, rather than drop down, and become unable to be stacked back up.
randomshift
shiftovernodrag
shiftup

@Denz1994
Copy link
Contributor

Denz1994 commented Apr 8, 2020

Note to self: Bucket.addParticleNearestOpen() may need to be used where the restoring bucket state isn't important. Bucket.placeAtom() should distinguish this using an argument.

@Denz1994 Denz1994 self-assigned this Apr 8, 2020
Denz1994 added a commit that referenced this issue Apr 8, 2020
…cases where resetting bucket state isn't important. #112
@Denz1994
Copy link
Contributor

Denz1994 commented Apr 8, 2020

Adjusting Bucket.placeAtom() worked well for handling the odd behavior described above. @KatieWoe can you verify in this dev version?

@Denz1994 Denz1994 removed their assignment Apr 8, 2020
@KatieWoe
Copy link
Contributor Author

KatieWoe commented Apr 8, 2020

Looks much better now. You can't really restack the atoms, like in the second gif, but you can move them around now, so I think this is probably satisfactory.

@KatieWoe KatieWoe assigned Denz1994 and unassigned KatieWoe Apr 8, 2020
@Denz1994
Copy link
Contributor

Denz1994 commented Apr 8, 2020

In the java version, a user could stack the atoms until the exited the carousel and spilled into the play area. I don't think we want this behavior but I'll let @arouinfar decide and close. @arouinfar Could you review and close if this looks good?

Here is the Java version:
image

@Denz1994
Copy link
Contributor

@arouinfar and I went over this and the stacking behavior mentioned above is something we don't want. As it stands we can't intentionally stack atoms anymore. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants