From 668555ba87a56cc7fd40c814da78f135ab19f3e2 Mon Sep 17 00:00:00 2001 From: Markus Hoelzner <37108490+mhoelzner@users.noreply.github.com> Date: Tue, 15 Sep 2020 11:10:16 +0200 Subject: [PATCH] Update cameraPathAnimation.js this._t will be in a range of 0.0 to 1.0 `this.cameraPath.frames[numFrames - 1].t` provides a giving frame index as of the example, so when `this.cameraPath.framescontains` of 7 frames the CameraPathAnimation.PLAYING status will last until this._t adds up to at least 6; --- examples/js/animation/cameraPathAnimation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/js/animation/cameraPathAnimation.js b/examples/js/animation/cameraPathAnimation.js index e663b6348..714d9cb96 100644 --- a/examples/js/animation/cameraPathAnimation.js +++ b/examples/js/animation/cameraPathAnimation.js @@ -179,7 +179,7 @@ xeogl.CameraPathAnimation = class xeoglCameraPathAnimation extends xeogl.Compone this._t += this._playingRate * f; const numFrames = this.cameraPath.frames.length; - if (numFrames === 0 || (this._playingDir < 0 && this._t <= 0) || (this._playingDir > 0 && this._t >= this.cameraPath.frames[numFrames - 1].t)) { + if (numFrames === 0 || (this._playingDir < 0 && this._t <= 0) || (this._playingDir > 0 && this._t >= 1.0)) { this.state = xeogl.CameraPathAnimation.SCRUBBING; this._t = this.cameraPath.frames[numFrames - 1].t; return; @@ -378,4 +378,4 @@ xeogl.CameraPathAnimation = class xeoglCameraPathAnimation extends xeogl.Compone xeogl.CameraPathAnimation.STOPPED = 0; xeogl.CameraPathAnimation.SCRUBBING = 1; xeogl.CameraPathAnimation.PLAYING = 2; -xeogl.CameraPathAnimation.PLAYING_TO = 3; \ No newline at end of file +xeogl.CameraPathAnimation.PLAYING_TO = 3;