diff --git a/src/components/scene-preview-camera.js b/src/components/scene-preview-camera.js index a6e715691519ca2ea9fbefe0c1011d8c1b836e82..46fde4498ae3b1ab583ac3a400ff8f1c0b0ddf1c 100644 --- a/src/components/scene-preview-camera.js +++ b/src/components/scene-preview-camera.js @@ -33,7 +33,12 @@ AFRAME.registerComponent("scene-preview-camera", { tick: function() { let t = (new Date().getTime() - this.startTime) / (1000.0 * this.data.duration); - t = (t * t) / (2 * (t * t - t) + 1); // Simple beizer smoothing + + if (!this.backwards) { + t = t * (2 - t); + } else { + t = t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; + } const from = this.backwards ? this.targetPoint : this.startPoint; const to = this.backwards ? this.startPoint : this.targetPoint;