phetsims/collision-lab

Clip Ball Values NumberDisplays?

Closed this issue · 3 comments

Currently, the Ball Values NumberDisplays are never clipped.

With values on, the number displays can be seen when the ball is way outside of the pool table. This also applies to the center of mass.
image

Should these be clipped by the bounds of the Pool Table? Or we could make them invisible if the ball's center exits the pool table, similar to how the velocity/momentum vectors and the change in momentum vectors are clipped.

Also, from looking at the ss above, should the center of mass 'x' be clipped as well?

Should these be clipped by the bounds of the Pool Table? Or we could make them invisible if the ball's center exits the pool table, similar to how the velocity/momentum vectors and the change in momentum vectors are clipped.

@brandonLi8 I think either of these options would work, but I prefer the latter for a few reasons

  • Consistent behavior with the vectors
  • Labels won't get clipped when the ball bounces off one of the borders.

Done in the commit above. Closing.