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