This commit is contained in:
Kseninia Mikhaylova 2024-09-06 14:31:15 +03:00
parent 4dd3e3d237
commit 0b55485dae
1 changed files with 8 additions and 8 deletions

View File

@ -36,7 +36,7 @@ const targetDistance = reactive({ max: 10, min: 0 })
let sidebar_clickable = [] as PromoScene[] let sidebar_clickable = [] as PromoScene[]
let sidebar_visible = [] as PromoScene[] let sidebar_visible = [] as PromoScene[]
const COUNT = 30 const COUNT = 50
type smooth = { type smooth = {
value: Vector3 | Quaternion | undefined, value: Vector3 | Quaternion | undefined,
count: number count: number
@ -232,8 +232,6 @@ const loadModels = async () => {
if (controls.value && (controls.value as any).autoRotate) { if (controls.value && (controls.value as any).autoRotate) {
(controls.value as any).autoRotate = false; (controls.value as any).autoRotate = false;
} }
// process_loading.value = null
} }
const gotoCenterAndDistance = () => { const gotoCenterAndDistance = () => {
@ -253,7 +251,6 @@ watch(() => props.source, () => {
} }
console.log('props change') console.log('props change')
sidebar.close() sidebar.close()
// loadModels()
} else { } else {
renderer.value.dispose() renderer.value.dispose()
} }
@ -279,8 +276,11 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
target_vector.setComponent(1, targetDistance.min) target_vector.setComponent(1, targetDistance.min)
set_moveto(smooth_target, target_vector) set_moveto(smooth_target, target_vector)
// set_moveto(smooth_move, target_vector.multiply(new Vector3(1.25, 1, 1.25).setY(targetDistance.min))) set_moveto(smooth_move, new Vector3(
set_moveto(smooth_move, new Vector3(targetDistance.min, targetDistance.min, targetDistance.min)) (target_vector.x / Math.abs(target_vector.x)) * targetDistance.min,
0,
(target_vector.z / Math.abs(target_vector.z)) * targetDistance.min
))
} }
} }
}, { deep: true }) }, { deep: true })
@ -302,8 +302,8 @@ onBeforeRender(() => {
} }
} }
}) })
// const koef = (1 / COUNT) * 3 const koef = (1 / COUNT) * 3
const koef = 0.05 // const koef = 0.05
if (smooth_target.value || smooth_move.value) { if (smooth_target.value || smooth_move.value) {
timer.resetTimer() timer.resetTimer()
home_timer.resetTimer() home_timer.resetTimer()