From 4ae419803343324c9efca7a971f70e828b24c3eb Mon Sep 17 00:00:00 2001 From: omar salah <114373468+omarsalaheldieen@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:47:35 +0300 Subject: [PATCH] feat: Update smooth_script --- assets/arTab/smooth_script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/arTab/smooth_script.js b/assets/arTab/smooth_script.js index e66319d..d8e1e3c 100644 --- a/assets/arTab/smooth_script.js +++ b/assets/arTab/smooth_script.js @@ -9,14 +9,14 @@ AFRAME.registerComponent("lerpsmooth", { if (this.el.object3D.visible) { // also make the object-to-smooth visible this.target.setAttribute('visible', 'true') + this.target.object3D.rotation.setFromVector3(this.el.object3D.rotation.toVector3()) // if we know about the previous position if(this.prevPosition) { // smooth position this.target.object3D.position.lerp(this.prevPosition, 0.1) // smooth rotation - let rot = this.target.object3D.rotation.toVector3().lerp(this.prevRotation, 0.1) - this.target.object3D.rotation.setFromVector3(rot) + // let rot = this.target.object3D.rotation.toVector3().lerp(this.prevRotation, 0.1) } // we don't know about the previous position else {