From 08417278e9013392dc269752457d69db29a7c0bf Mon Sep 17 00:00:00 2001 From: Anatoly Date: Sat, 29 Jan 2022 23:26:57 +0300 Subject: [PATCH] Reset everything --- bundle/vue-three-d-mockup.esm.js | 4 ++++ src/MockupModel.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bundle/vue-three-d-mockup.esm.js b/bundle/vue-three-d-mockup.esm.js index 72333d8..d00e4e2 100644 --- a/bundle/vue-three-d-mockup.esm.js +++ b/bundle/vue-three-d-mockup.esm.js @@ -11,7 +11,10 @@ class MockupModel extends Group { this.goingHome = false; this.home = home; + this.reset(); + } + reset() { this.position.x = this.home.position.x; this.position.y = this.home.position.y; this.position.z = this.home.position.z; @@ -54,6 +57,7 @@ class MockupModel extends Group { setTimeout(() => { this.goingHome = false; + this.reset(); this.startFloat(); }, rT * 1000); } diff --git a/src/MockupModel.js b/src/MockupModel.js index 518ee61..71e9bb2 100644 --- a/src/MockupModel.js +++ b/src/MockupModel.js @@ -8,7 +8,10 @@ export default class MockupModel extends Group { this.goingHome = false; this.home = home; + this.reset(); + } + reset() { this.position.x = this.home.position.x; this.position.y = this.home.position.y; this.position.z = this.home.position.z; @@ -51,6 +54,7 @@ export default class MockupModel extends Group { setTimeout(() => { this.goingHome = false; + this.reset(); this.startFloat(); }, rT * 1000); }