bx-1379-redesign #15
|
@ -273,6 +273,8 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
|
||||
el.getWorldPosition(target_vector);
|
||||
target_vector.y = raw_dataStore.data.min_distance > 50 ? raw_dataStore.data.min_distance / 10 : 1;
|
||||
const target_vector_1 = target_vector.clone().multiplyScalar(3)
|
||||
console.log(target_vector, target_vector_1)
|
||||
|
||||
const quaternion = new Quaternion();
|
||||
quaternion.setFromEuler(new Euler(
|
||||
|
@ -283,16 +285,19 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
|
||||
set_moveto(smooth_rotate, quaternion)
|
||||
|
||||
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;
|
||||
const d = raw_dataStore.data.max_distance * 0.5
|
||||
if(camera.value?.position && camera.value?.position.distanceTo(new Vector3(d,d,d)) > 20) {
|
||||
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(d, d, d))
|
||||
} else {
|
||||
set_moveto(smooth_target, target_vector)
|
||||
set_moveto(smooth_move, target_vector)
|
||||
}
|
||||
|
||||
vis_target.value = target_vector;
|
||||
}
|
||||
}
|
||||
}, { deep: true })
|
||||
|
@ -311,7 +316,7 @@ onAfterRender(() => {
|
|||
}
|
||||
}
|
||||
})
|
||||
const koef = 0.02
|
||||
const koef = 1 / COUNT
|
||||
if (smooth_target.value) {
|
||||
timer.stopTimer();
|
||||
(controls.value as any).target.lerp(smooth_target.value, koef);
|
||||
|
|
Loading…
Reference in New Issue