diff --git a/front/src/components/Promo/load_models.vue b/front/src/components/Promo/load_models.vue index 014c93a..3de0425 100644 --- a/front/src/components/Promo/load_models.vue +++ b/front/src/components/Promo/load_models.vue @@ -237,6 +237,13 @@ const gotoCenterAndDistance = () => { def_distance.max * 0.5, def_distance.max * 0.5 ); + + clickable.list.forEach(element => { + const el = seekByName(scene.value, `${element.id}_clickable`); + if (el?.visible == false) { + el.visible = true + } + }); } loadModels() @@ -251,21 +258,28 @@ watch(() => props.source, () => { watch(() => sidebar, () => { if (sidebar.is_open == false) { - gotoCenterAndDistance() + gotoCenterAndDistance(); } if (sidebar.is_open && sidebar.id_clickable) { const clickable = useClickable() + clickable.list.forEach(element => { + const el = seekByName(scene.value, `${element.id}_clickable`); + if (el?.visible == false) { + el.visible = true + } + }); const target = clickable.list.find(el => el.id == sidebar.id_clickable) if (!target) return const el = seekByName(scene.value, `${sidebar.id_clickable}_clickable`); if (el) { + el.visible = false; (controls.value as any).maxDistance = 10; (controls.value as any).minDistance = 1; const target_vector = new Vector3(); el.getWorldPosition(target_vector); controls_targetto.value = target_vector; - camera_rotatetoto.value = new Quaternion(0, 1, 0.25, -0.25) + camera_rotatetoto.value = new Quaternion(-0.5, -0.25, -0.125, 0.875,) } } }, { deep: true }) @@ -304,6 +318,7 @@ onAfterRender(() => { if (camera_rotatetoto.value) { timer.stopTimer(); camera.value?.quaternion.slerp(camera_rotatetoto.value, 0.01); + camera.value?.quaternion.normalize(); camera_rotatetoto_count.value -= 1; if (camera_rotatetoto_count.value == 0) { camera_rotatetoto_count.value = CAM_MOVETO_COUNT @@ -315,6 +330,7 @@ const timer = useTimer() timer.timer_func = () => { if (timer.seconds_left == 0 && !(controls.value as any).autoRotate && (controls.value as any).enabled) { gotoCenterAndDistance(); + sidebar.close(); (controls.value as any).autoRotate = true; (controls.value as any).autoRotateSpeed = 0.5; }