bx-1379-redesign #15
|
@ -279,7 +279,8 @@ 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)))
|
// set_moveto(smooth_move, target_vector.multiply(new Vector3(1.25, 1, 1.25).setY(targetDistance.min)))
|
||||||
|
set_moveto(smooth_move, new Vector3(targetDistance.min, targetDistance.min, targetDistance.min))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
@ -307,31 +308,34 @@ onBeforeRender(() => {
|
||||||
timer.resetTimer()
|
timer.resetTimer()
|
||||||
home_timer.resetTimer()
|
home_timer.resetTimer()
|
||||||
|
|
||||||
if (smooth_move.value) {
|
if (smooth_target.value) {
|
||||||
camera.value?.position.lerp(smooth_move.value as Vector3, koef);
|
(controls.value as any).target.lerp(smooth_target.value as Vector3, koef);
|
||||||
camera.value?.updateMatrixWorld()
|
(controls.value as any).update()
|
||||||
smooth_move.count -= 1
|
smooth_target.count -= 1
|
||||||
if (smooth_move.count == 1) {
|
if (smooth_target.count == 1) {
|
||||||
set_moveto(smooth_move, undefined)
|
set_moveto(smooth_target, undefined)
|
||||||
if (temp_smooth_move.value) {
|
if (temp_smooth_target.value) {
|
||||||
set_moveto(smooth_move, temp_smooth_move.value)
|
set_moveto(smooth_target, temp_smooth_target.value)
|
||||||
set_moveto(temp_smooth_move, undefined)
|
set_moveto(temp_smooth_target, undefined)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (smooth_target.value) {
|
if (smooth_move.value) {
|
||||||
(controls.value as any).target.lerp(smooth_target.value as Vector3, koef);
|
camera.value?.position.lerp(smooth_move.value as Vector3, koef);
|
||||||
|
camera.value?.updateMatrixWorld();
|
||||||
(controls.value as any).update()
|
(controls.value as any).update()
|
||||||
smooth_target.count -= 1
|
|
||||||
if (smooth_target.count == 1) {
|
smooth_move.count -= 1
|
||||||
set_moveto(smooth_target, undefined)
|
if (smooth_move.count == 1) {
|
||||||
if (temp_smooth_target.value) {
|
set_moveto(smooth_move, undefined)
|
||||||
set_moveto(smooth_target, temp_smooth_target.value)
|
if (temp_smooth_move.value) {
|
||||||
set_moveto(temp_smooth_target, undefined)
|
set_moveto(smooth_move, temp_smooth_move.value)
|
||||||
|
set_moveto(temp_smooth_move, undefined)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue