Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Janine Liu <32226860+j9liu@users.noreply.github.com>
  • Loading branch information
markw65 and j9liu authored May 5, 2022
1 parent ebfbde1 commit c78ba69
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 2 additions & 3 deletions Source/Scene/ModelAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ Object.defineProperties(ModelAnimation.prototype, {
* @returns {Number} Returns the local animation time.
*
* @example
* // Use real time for model animation (also set
* // ModelAnimationCollection#animateWhilePaused)
* // Use real time for model animation (assuming animateWhilePaused was set to true)
* function animationTime(duration) {
* return Date.now() / 1000 / duration;
* }
Expand All @@ -259,7 +258,7 @@ Object.defineProperties(ModelAnimation.prototype, {
* // Offset the phase of the animation, so it starts halfway
* // through its cycle.
* function animationTime(duration, seconds) {
* return seconds / duration + .5;
* return seconds / duration + 0.5;
* }
*/
export default ModelAnimation;
4 changes: 3 additions & 1 deletion Source/Scene/ModelAnimationCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ ModelAnimationCollection.prototype.update = function (frameState) {
scheduledAnimation._state === ModelAnimationState.STOPPED;
// no change to delta, and no change to the animation state means we can
// skip the update this time around.
if (play !== animationStopped) continue;
if (play !== animationStopped) {
continue;
}
}
scheduledAnimation._prevAnimationDelta = delta;

Expand Down
5 changes: 2 additions & 3 deletions Source/Scene/ModelExperimental/ModelExperimentalAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ ModelExperimentalAnimation.prototype.animate = function (time) {
* @returns {Number} Returns the local animation time.
*
* @example
* // Use real time for model animation (also set
* // ModelExperimentalAnimationCollection#animateWhilePaused)
* // Use real time for model animation (assuming animateWhilePaused was set to true)
* function animationTime(duration) {
* return Date.now() / 1000 / duration;
* }
Expand All @@ -410,7 +409,7 @@ ModelExperimentalAnimation.prototype.animate = function (time) {
* // Offset the phase of the animation, so it starts halfway
* // through its cycle.
* function animationTime(duration, seconds) {
* return seconds / duration + .5;
* return seconds / duration + 0.5;
* }
*/
export default ModelExperimentalAnimation;
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ ModelExperimentalAnimationCollection.prototype.update = function (frameState) {
runtimeAnimation._state === ModelAnimationState.STOPPED;
// no change to delta, and no change to the animation state means we can
// skip the update this time around.
if (play !== animationStopped) continue;
if (play !== animationStopped) {
continue;
}
}
runtimeAnimation._prevAnimationDelta = delta;

Expand Down

0 comments on commit c78ba69

Please sign in to comment.