Closed zepumph closed 1 month ago
This is getting us in the right direction, but still has some work to do and review, like the TODOs in it.
@AgustinVallejo and I also wrote to @jessegreenberg on slack:
Hi @jessegreenberg. I’m working with @AgustinVallejo on https://github.com/phetsims/density-buoyancy-common/issues/209 where we would like to use GrabDragInteraction to publish Buoyancy 1.0. We opened https://github.com/phetsims/scenery-phet/issues/863 to convert it to TypeScript. While we were there, we also saw several issues related to GrabDragInteraction: https://github.com/phetsims/scenery-phet/issues?q=is%3Aissue+is%3Aopen+grabDragInteraction. Some are related to voicing which is not in the purview for Buoyancy 1.0. Others we wanted to ask you about--do we need to do anything to get ready for production?
@jessegreenberg identified https://github.com/phetsims/scenery-phet/issues/708 as potentially related to GrabDragInteraction for our upcoming publication, so we added it to the project board.
The initial focus area is offset:
Minor refactoring and experimentation:
I cannot get the text cue to display. @jessegreenberg are you available to assist?
@marlitas helped us get even further, now the cue is showing and the dotted line is showing:
I thought I may be able to get a lead on the above malalignment by looking at how the p2 body and the Mass.matrix stay in sync. I couldn't really tell if things get off there, but I was pointed to Mass.updateDrag() as a potential lead. Adding these two lines at the end of that function didn't do anything noticeable.
this.readData();
this.transformedEmitter.emit();
There is another TODO to position the grab cue below the mass. I wonder if we will want to create a custom Property to position each at the right spot, like for force/tag/massLabel:
Otherwise, I don't think we can come to a general solution for all mass shapes.
From https://github.com/phetsims/density-buoyancy-common/issues/190, because tabbing to the blocks makes the gravity no longer effect the block, a "tab then grab" interaction seems best. We also, in design meeting, discussed how this case would be similar to ESP where a skater is moving in a half pipe. Tabbing to the skater shouldn't pause the skater. This is a overload of the focus() event, and so GrabDragInteraction is likely a good solution here. Let's take a look.