Skip to content

Commit

Permalink
improve docs about animations, see #109
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Mar 7, 2025
1 parent b80c5f7 commit cb1ac7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions js/coins/view/MaxCoinsViewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
* MaxCoinsViewManager creates and manages the node that is used to represent the set of 10k coins in the experiment. It
* creates the node that represents this set of coins and animates it from the preparation area to the test box.
*
* The animations here are pretty complex due to the need to move the cains in areas outside the bounds of the node in
* which they originate, to handle the large number of coins, and to handle the inflation animation that is used to
* represent the coins as they move from the preparation area to the measurement area.
*
* @author John Blanco (PhET Interactive Simulations)
* @author Agustín Vallejo
*/
Expand Down
3 changes: 3 additions & 0 deletions js/coins/view/MultipleCoinsViewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* thus appear to originate there, and move into the measurement area. This is used for the 10 and 100 coin cases. The
* 10k case is handled differently and is not included here.
*
* The animations here are pretty complex due to the need to mask the coins in some cases, to handle different numbers,
* of coins, and to move the cains in areas outside the bounds of the node in which they originate.
*
* @author John Blanco, PhET Interactive Simulations
*/

Expand Down
5 changes: 4 additions & 1 deletion js/coins/view/SingleCoinViewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* experiment. This includes the animation of the coin moving from the preparation area to the measurement area, as
* well as providing support for the coin flipping animation.
*
* The animations here are pretty complex due to the need to mask the coins in some cases, to work with clip areas, and
* to move the cains in areas outside the bounds of the node in which they originate.
*
* @author John Blanco, PhET Interactive Simulations
*/

Expand Down Expand Up @@ -146,7 +149,7 @@ class SingleCoinViewManager {
// process consists of two animations, one to move the coin to the left edge of the test box while the test box is
// potentially also moving, then a second one to move the coin into the box. The durations must be set up such
// that the test box is in place before the 2nd animation begins or the coin won't end up in the right place.
const testBoxXOffset = forReprepare ? 180 : 250; // empirically determined
const testBoxXOffset = forReprepare ? 180 : 250; // empirically determined, adjust as needed
const leftOfTestBoxGlobal = singleCoinTestBox.parentToGlobalPoint(
singleCoinTestBox.center.minusXY( testBoxXOffset, 0 )
);
Expand Down

0 comments on commit cb1ac7b

Please sign in to comment.