Removed switch statement

This commit is contained in:
2022-01-29 23:58:13 +03:00
parent 08417278e9
commit d497bfca8d
3 changed files with 16 additions and 52 deletions

View File

@@ -157,21 +157,22 @@ export default {
currentTime *= 0.001;
const deltaTime = currentTime - previousTime;
previousTime = currentTime;
requestAnimationFrame(animate);
if (phone) {
phone.anim(deltaTime, { mouseX, mouseY, cameraZ: camera.position.z });
phone.animation(deltaTime, { x: mouseX, y: mouseY, z: camera.position.z });
}
renderer.render(scene, camera);
}
function handleMouseEnter() {
if (phone) { phone.animation = 'lookAt'; }
if (phone) { phone.animation = phone.lookAtAnim; }
}
function handleMouseLeave() {
if (phone) { phone.animation = 'home'; }
if (phone) { phone.animation = phone.homeAnim; }
}
function handleMouseMove(event) {