bx-1379-redesign #15

Merged
ksenia_mikhailova merged 124 commits from bx-1379-redesign into dev 2024-09-06 15:39:13 +03:00
1 changed files with 1 additions and 22 deletions
Showing only changes of commit f529eedadb - Show all commits

View File

@ -273,13 +273,6 @@ const gotoCenterAndDistance = () => {
raw_dataStore.data.max_distance * 0.5, raw_dataStore.data.max_distance * 0.5,
raw_dataStore.data.max_distance * 0.5 raw_dataStore.data.max_distance * 0.5
); );
clickable.list.forEach(element => {
const el = seekByName(scene.value, `${element.id}_clickable`);
if (el?.visible == false) {
el.visible = true
}
});
} }
watch(() => props.source, () => { watch(() => props.source, () => {
@ -303,17 +296,10 @@ watch(() => sidebar, () => {
} }
if (sidebar.is_open && sidebar.id_clickable) { if (sidebar.is_open && sidebar.id_clickable) {
const clickable = useClickable() 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) const target = clickable.list.find(el => el.id == sidebar.id_clickable)
if (!target) return if (!target) return
const el = seekByName(scene.value, `${sidebar.id_clickable}_clickable`); const el = seekByName(scene.value, `${sidebar.id_clickable}_clickable`);
if (el) { if (el) {
el.visible = false;
(controls.value as any).maxDistance = 10; (controls.value as any).maxDistance = 10;
(controls.value as any).minDistance = 1; (controls.value as any).minDistance = 1;
const target_vector = new Vector3(); const target_vector = new Vector3();
@ -408,14 +394,7 @@ const clickEvent = (event: MouseEvent) => {
const intersects = raycaster.value.intersectObjects(clickable_objects); const intersects = raycaster.value.intersectObjects(clickable_objects);
const names = intersects const names = intersects
.map(el => (el.object.parent ? el.object.parent.name : el.object.name) ?? false) .map(el => (el.object.parent ? el.object.parent.name : el.object.name) ?? false)
.filter(el => { .filter(Boolean)
if (clickable_objects) {
const f = clickable_objects.find(item => item.name == el);
return f ? f.visible == true : false
}
return false
}
).filter(Boolean)
if (names.length) { if (names.length) {
sidebar.open(parseInt(names[0].replace('_clickable', ''))) sidebar.open(parseInt(names[0].replace('_clickable', '')))
} }