phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Manual calculations done with particleViewPositionVector instead of using particleTransform #108

Closed Luisav1 closed 1 year ago

Luisav1 commented 1 year ago

There are many places throughout the sim which are doing manual calculations on particleViewPositionVector, which is the same as using the particleTransform, according to its implementation:

this.particleTransform = ModelViewTransform2.createSinglePointScaleMapping( Vector2.ZERO, options.particleViewPositionVector, 1 );

For this reason, we should investigate which manual calculations can be replaced by the particleTransform. Do so carefully however since there are some cases that use particleViewPositionVector, but not as an MVT thus they cannot be replaced with particleTransform.

This may be related to https://github.com/phetsims/build-a-nucleus/issues/73 which removed some unecessary MVT uses in NucleonShellView.

Luisav1 commented 1 year ago

The commit https://github.com/phetsims/build-a-nucleus/commit/4f58fe55129a9db3bcd129403609733c50ad9062 for https://github.com/phetsims/build-a-nucleus/issues/73 removed the MVT uses, instead doing manual calculations on particleViewPositionVector since the MVTs were being excessively used.

zepumph commented 1 year ago

I only see very good usages of particleViewPosition at this point. Thanks for all this work @Luisav1. Anything else here?

Luisav1 commented 1 year ago

All necessary manual calculations were removed in the above commits. There's nothing else here! Closing.