mirror of
https://github.com/anatolykopyl/vue-three-d-mockup.git
synced 2026-03-26 12:55:08 +00:00
Start floating on load
This commit is contained in:
@@ -11,9 +11,11 @@ class MockupModel extends Group {
|
|||||||
this.goingHome = false;
|
this.goingHome = false;
|
||||||
|
|
||||||
this.home = home;
|
this.home = home;
|
||||||
|
|
||||||
this.position.x = this.home.position.x;
|
this.position.x = this.home.position.x;
|
||||||
this.position.y = this.home.position.z;
|
this.position.y = this.home.position.y;
|
||||||
this.position.z = this.home.position.z;
|
this.position.z = this.home.position.z;
|
||||||
|
|
||||||
this.rotation.x = this.home.rotation.x;
|
this.rotation.x = this.home.rotation.x;
|
||||||
this.rotation.y = this.home.rotation.y;
|
this.rotation.y = this.home.rotation.y;
|
||||||
this.rotation.z = this.home.rotation.z;
|
this.rotation.z = this.home.rotation.z;
|
||||||
@@ -242,6 +244,7 @@ var script = {
|
|||||||
z: 0.06,
|
z: 0.06,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
phone.startFloat();
|
||||||
scene.add(phone);
|
scene.add(phone);
|
||||||
screenInit();
|
screenInit();
|
||||||
bodyInit();
|
bodyInit();
|
||||||
@@ -271,11 +274,11 @@ var script = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseEnter() {
|
function handleMouseEnter() {
|
||||||
phone.animation = 'lookAt';
|
if (phone) { phone.animation = 'lookAt'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseLeave() {
|
function handleMouseLeave() {
|
||||||
phone.animation = 'home';
|
if (phone) { phone.animation = 'home'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseMove(event) {
|
function handleMouseMove(event) {
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ export default {
|
|||||||
z: 0.06,
|
z: 0.06,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
phone.startFloat();
|
||||||
scene.add(phone);
|
scene.add(phone);
|
||||||
screenInit();
|
screenInit();
|
||||||
bodyInit();
|
bodyInit();
|
||||||
@@ -166,11 +167,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseEnter() {
|
function handleMouseEnter() {
|
||||||
phone.animation = 'lookAt';
|
if (phone) { phone.animation = 'lookAt'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseLeave() {
|
function handleMouseLeave() {
|
||||||
phone.animation = 'home';
|
if (phone) { phone.animation = 'home'; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseMove(event) {
|
function handleMouseMove(event) {
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ export default class MockupModel extends Group {
|
|||||||
this.goingHome = false;
|
this.goingHome = false;
|
||||||
|
|
||||||
this.home = home;
|
this.home = home;
|
||||||
|
|
||||||
this.position.x = this.home.position.x;
|
this.position.x = this.home.position.x;
|
||||||
this.position.y = this.home.position.z;
|
this.position.y = this.home.position.y;
|
||||||
this.position.z = this.home.position.z;
|
this.position.z = this.home.position.z;
|
||||||
|
|
||||||
this.rotation.x = this.home.rotation.x;
|
this.rotation.x = this.home.rotation.x;
|
||||||
this.rotation.y = this.home.rotation.y;
|
this.rotation.y = this.home.rotation.y;
|
||||||
this.rotation.z = this.home.rotation.z;
|
this.rotation.z = this.home.rotation.z;
|
||||||
|
|||||||
Reference in New Issue
Block a user