bx-1379-redesign #15
|
@ -48,7 +48,6 @@ const controlsState = reactive({
|
||||||
|
|
||||||
const raw_dataStore = useRawData()
|
const raw_dataStore = useRawData()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const clickable = useClickable()
|
|
||||||
const sidebarScene = usePromoScene()
|
const sidebarScene = usePromoScene()
|
||||||
|
|
||||||
watch(() => route.params.target, sidebar.close)
|
watch(() => route.params.target, sidebar.close)
|
||||||
|
|
|
@ -40,7 +40,7 @@ const controls_targetto_count = ref(COUNT)
|
||||||
const camera_moveto = ref() as Ref<Vector3 | undefined>;
|
const camera_moveto = ref() as Ref<Vector3 | undefined>;
|
||||||
const camera_moveto_count = ref(COUNT)
|
const camera_moveto_count = ref(COUNT)
|
||||||
const camera_rotatetoto = ref() as Ref<Quaternion | undefined>;
|
const camera_rotatetoto = ref() as Ref<Quaternion | undefined>;
|
||||||
const camera_rotatetoto_count = ref(COUNT)
|
const camera_rotatetoto_count = ref(10)
|
||||||
|
|
||||||
const sidebar = usePromoSidebar();
|
const sidebar = usePromoSidebar();
|
||||||
const sidebar_scene = usePromoScene();
|
const sidebar_scene = usePromoScene();
|
||||||
|
@ -264,9 +264,11 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
||||||
controls_targetto.value = target_vector;
|
controls_targetto.value = target_vector;
|
||||||
|
|
||||||
const quaternion = new Quaternion();
|
const quaternion = new Quaternion();
|
||||||
quaternion.setFromAxisAngle(new Vector3(1, 0, 0), -45 * 4 * (Math.PI / 180));
|
quaternion.setFromAxisAngle(new Vector3(1, 0, 0), -15 * (Math.PI / 180));
|
||||||
|
// quaternion.setFromAxisAngle(new Vector3(0, 1, 0), -25 * (Math.PI / 180));
|
||||||
|
// quaternion.setFromAxisAngle(new Vector3(0, 0, 1), 10 * (Math.PI / 180));
|
||||||
|
|
||||||
camera_rotatetoto.value = quaternion
|
camera_rotatetoto.value = quaternion
|
||||||
// camera.value.rotation.z += Math.PI/2
|
|
||||||
camera_moveto.value = target_vector;
|
camera_moveto.value = target_vector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,15 +312,16 @@ onAfterRender(() => {
|
||||||
}
|
}
|
||||||
if (!camera_moveto.value && !controls_targetto.value && camera_rotatetoto.value) {
|
if (!camera_moveto.value && !controls_targetto.value && camera_rotatetoto.value) {
|
||||||
timer.stopTimer();
|
timer.stopTimer();
|
||||||
camera.value?.quaternion.slerp(camera_rotatetoto.value, koef);
|
camera.value?.quaternion.slerp(camera_rotatetoto.value, 0.5);
|
||||||
// camera.value?.quaternion.normalize();
|
camera.value?.quaternion.normalize()
|
||||||
camera_rotatetoto_count.value -= 1;
|
camera_rotatetoto_count.value -= 1;
|
||||||
if (camera_rotatetoto_count.value == 0) {
|
if (camera_rotatetoto_count.value == 0) {
|
||||||
camera_rotatetoto_count.value = COUNT;
|
camera_rotatetoto_count.value = 10;
|
||||||
camera_rotatetoto.value = undefined
|
camera_rotatetoto.value = undefined
|
||||||
}
|
}
|
||||||
|
camera.value?.updateMatrixWorld()
|
||||||
}
|
}
|
||||||
(controls.value as any).update()
|
// (controls.value as any).update()
|
||||||
})
|
})
|
||||||
|
|
||||||
const timer = useTimer()
|
const timer = useTimer()
|
||||||
|
|
Loading…
Reference in New Issue