mirror of
https://github.com/anatolykopyl/vue-three-d-mockup.git
synced 2026-03-26 21:05:10 +00:00
Fixed bug with rapid mouse movement
This commit is contained in:
@@ -169,7 +169,11 @@ export default {
|
||||
}
|
||||
|
||||
function handleMouseEnter() {
|
||||
if (phone) { phone.animation = phone.lookAtAnim; }
|
||||
if (phone) {
|
||||
phone.animation = phone.lookAtAnim;
|
||||
phone.goingHome = false;
|
||||
clearTimeout(phone.homeTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
function handleMouseLeave() {
|
||||
|
||||
@@ -6,6 +6,7 @@ export default class MockupModel extends Group {
|
||||
|
||||
this.animation = this.floatAnim;
|
||||
this.goingHome = false;
|
||||
this.homeTimeout = null;
|
||||
|
||||
this.home = home;
|
||||
this.reset();
|
||||
@@ -52,7 +53,7 @@ export default class MockupModel extends Group {
|
||||
this.rotSpeed.y = (this.home.rotation.y - this.rotation.y) / rT;
|
||||
this.rotSpeed.z = (this.home.rotation.z - this.rotation.z) / rT;
|
||||
|
||||
setTimeout(() => {
|
||||
this.homeTimeout = setTimeout(() => {
|
||||
this.goingHome = false;
|
||||
this.reset();
|
||||
this.startFloat();
|
||||
|
||||
Reference in New Issue
Block a user