phetsims/quadrilateral

Shape jitter and vertex position uncertainty when moving two sides simultaneously

Closed this issue · 7 comments

I'm not sure if this is related to the recent crashes, but when attempting to drag two sides simultaneously using a touchscreen, there is jitter and the sides appear to warp around a bit (as though it's not certain which finger to prioritize..?) Will try to get a video.

Confirmed. It kind of feels like a performance issue to me. When dragging one side or multiple vertices the framerate is ~55 fps but when dragging two sides the framerate goes down to ~15 fps with ?profiler.

I get a similar stutter (but maybe not quite as bad) when I drag all 4 vertices at once. But performance is better when dragging 3 vertices at once.

EDIT: I just tried to use the dev tools performance profiler and all stuttering stopped. What usage path did I do to make it better?

EDIT: The sim now has no stutter when I do a fresh reload. I think maybe opening the dev tools blew away a cache/old code and the most up-to-date version of the sim doesn't have this issue. I can no longer reproduce this.

@BLFiedler I saw this issue the first time I loaded the sim on my touchscreen device but after clearing the cache I am not seeing this anymore. Is this still an issue for you?

Discussed during meeting today: The issue was actually that dragging two adjacent sides doesn't work well, as both sides move with input and the shared vertex jumps around. We discussed a little how it should behave, but didn't come to a conclusion. @BLFiedler will consider how multitouch with side dragging should behave.

Let's revisit this when the model changes for collision are implemented in #41

I don't see an intuitive behavior here worth building out for adjacent sides simultaneously being dragged. Let's pass control to the first side that is pressed when an adjacent side is dragged. The second "multitouched" side drag does nothing.

  • Implement multitouch behavior for two adjacent side dragging that gives control to the first side interaction

@jessegreenberg, if this ends up sounding like more than a few lines of code, then we'll just leave it as an acceptable bug.

OK, done in the above commit. When a side is pressed, its adjacent sides basically have input disabled. I think that supports this.

@BLFiedler can you please test this and multitouch cases now?

Works as advertised. 2-4 vertex control, opposite side control, but no adjacent side simultaneous control!