camera pos

This commit is contained in:
Kseninia Mikhaylova 2024-08-27 11:37:02 +03:00
parent 2ef435235d
commit 3d5346fa74
2 changed files with 8 additions and 3 deletions

View File

@ -279,7 +279,10 @@ watch(() => sidebar, () => {
el.getWorldPosition(target_vector); el.getWorldPosition(target_vector);
target_vector.y = 0; target_vector.y = 0;
(controls.value as any).target = target_vector; (controls.value as any).target = target_vector;
camera.value?.position.set(30, 30, 30) camera.value?.position.set(30, 30, 30);
(controls.value as any)._needsUpdate = true;
(controls.value as any).update()
// camera.value?.rotation.set(0,0,1)
} }
} }
}, { deep: true }) }, { deep: true })

View File

@ -16,11 +16,13 @@ const openedChange = () => {
sidebar.open(opened_desc.value) sidebar.open(opened_desc.value)
} }
watch(() => sidebar.$state.is_open, () => { watch(() => sidebar, () => {
if (sidebar.is_open == false) { if (sidebar.is_open == false) {
opened_desc.value = null opened_desc.value = null
} else {
opened_desc.value = sidebar.id_clickable
} }
}) }, { deep: true })
</script> </script>
<template> <template>
<div class="sidebar" :class="[{ 'open': sidebar.is_open }]" ref="sidebar_obj"> <div class="sidebar" :class="[{ 'open': sidebar.is_open }]" ref="sidebar_obj">