bx-1379-redesign #15
|
@ -272,7 +272,7 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
|
||||
const target_vector = new Vector3();
|
||||
el.getWorldPosition(target_vector);
|
||||
target_vector.setComponent(1, raw_dataStore.data.min_distance > 50 ? raw_dataStore.data.min_distance / 10 : 1)
|
||||
target_vector.setComponent(1, raw_dataStore.data.min_distance > 50 ? raw_dataStore.data.min_distance / 7 : 1)
|
||||
|
||||
const d = raw_dataStore.data.max_distance * 0.5;
|
||||
const lerp_vector = new Vector3(
|
||||
|
@ -281,17 +281,17 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
((camera.value?.position as Vector3).z + target_vector.z) * 0.5,
|
||||
)
|
||||
lerp_vector.setComponent(1, d)
|
||||
// const multiply = new Vector3(1.5, 1.5, 0)
|
||||
const multiply = new Vector3(1.25, 1, 1.25)
|
||||
|
||||
const target_move = target_vector.multiply(multiply)
|
||||
const lerp_move = lerp_vector.multiply(multiply)
|
||||
|
||||
const target_move = target_vector
|
||||
const lerp_move = lerp_vector
|
||||
// console.log({
|
||||
// target_vector,
|
||||
// target_move
|
||||
// })
|
||||
if (
|
||||
camera.value?.position && camera.value?.position.distanceTo(lerp_move) > d ||
|
||||
camera.value?.position && camera.value?.position.distanceTo(target_move) > 10
|
||||
camera.value?.position
|
||||
&& (
|
||||
camera.value?.position.distanceTo(lerp_move) > d
|
||||
|| camera.value?.position.distanceTo(target_move) > 10
|
||||
)
|
||||
) {
|
||||
set_moveto(smooth_target, lerp_vector)
|
||||
set_moveto(smooth_move, lerp_move)
|
||||
|
@ -309,7 +309,7 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
|||
const { onBeforeRender } = useLoop()
|
||||
onBeforeRender(() => {
|
||||
clickable_refs.value.map(el => {
|
||||
el.value[0].visible = (camera.value?.position as Vector3).distanceTo(controls.value.target) < raw_dataStore.data.min_distance ? false : true;
|
||||
el.value[0].visible = (camera.value?.position as Vector3).distanceTo((controls.value as any).target) < raw_dataStore.data.min_distance ? false : true;
|
||||
if (el.value[0] && el.value[0].children) {
|
||||
el.value[0].children[0].lookAt(camera.value?.position);
|
||||
el.value[0].children[0].rotateX(90 * (Math.PI / 180));
|
||||
|
@ -330,7 +330,7 @@ onBeforeRender(() => {
|
|||
temp_el: temp_smooth_target,
|
||||
f: () => {
|
||||
(controls.value as any).target.lerp(smooth_target.value as Vector3, koef);
|
||||
(controls.value as any).update()
|
||||
// (controls.value as any).update()
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -338,7 +338,7 @@ onBeforeRender(() => {
|
|||
temp_el: temp_smooth_move,
|
||||
f: () => {
|
||||
camera.value?.position.lerp(smooth_move.value as Vector3, koef);
|
||||
camera.value?.updateMatrixWorld()
|
||||
// camera.value?.updateMatrixWorld()
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue