camera
This commit is contained in:
parent
8ff62ccf74
commit
8e83a89698
|
@ -43,6 +43,9 @@ type smooth = {
|
|||
const smooth_target = reactive({}) as smooth
|
||||
const smooth_move = reactive({}) as smooth
|
||||
const smooth_rotate = reactive({}) as smooth
|
||||
const temp_smooth_target = reactive({}) as smooth
|
||||
const temp_smooth_move = reactive({}) as smooth
|
||||
const temp_smooth_rotate = reactive({}) as smooth
|
||||
|
||||
const vis_target = ref()
|
||||
|
||||
|
@ -279,8 +282,16 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
));
|
||||
|
||||
set_moveto(smooth_rotate, quaternion)
|
||||
set_moveto(smooth_target, target_vector)
|
||||
set_moveto(smooth_move, target_vector)
|
||||
|
||||
set_moveto(temp_smooth_target, target_vector)
|
||||
set_moveto(temp_smooth_move, target_vector)
|
||||
|
||||
set_moveto(smooth_target, new Vector3(0, 0, 0))
|
||||
set_moveto(smooth_move, new Vector3(
|
||||
raw_dataStore.data.max_distance * 0.5,
|
||||
raw_dataStore.data.max_distance * 0.5,
|
||||
raw_dataStore.data.max_distance * 0.5
|
||||
))
|
||||
vis_target.value = target_vector;
|
||||
}
|
||||
}
|
||||
|
@ -307,6 +318,11 @@ onAfterRender(() => {
|
|||
smooth_target.count -= 1
|
||||
if (smooth_target.count == 0) {
|
||||
set_moveto(smooth_target, undefined)
|
||||
|
||||
if (temp_smooth_target) {
|
||||
set_moveto(smooth_target, temp_smooth_target.value)
|
||||
set_moveto(temp_smooth_target, undefined)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (smooth_move.value) {
|
||||
|
@ -316,6 +332,11 @@ onAfterRender(() => {
|
|||
if (smooth_move.count == 0) {
|
||||
// camera.value?.lookAt(camera_moveto.value)
|
||||
set_moveto(smooth_move, undefined)
|
||||
|
||||
if (temp_smooth_move) {
|
||||
set_moveto(smooth_move, temp_smooth_move.value)
|
||||
set_moveto(temp_smooth_move, undefined)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (smooth_rotate.value) {
|
||||
|
|
Loading…
Reference in New Issue