small fix for distance
This commit is contained in:
parent
e315e167e3
commit
23e3b9edce
|
@ -71,5 +71,11 @@ services:
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
network:
|
||||||
|
driver: bridge
|
||||||
dev:
|
dev:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 10.67.0.0/24
|
||||||
|
gateway: 10.67.0.1
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
|
|
||||||
import { useTresContext, useSeek, useLoop } from '@tresjs/core';
|
import { useTresContext, useSeek, useLoop } from '@tresjs/core';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { useGLTF } from '@tresjs/cientos'
|
import { useGLTF, useGLTFExporter } from '@tresjs/cientos'
|
||||||
|
|
||||||
import Env from './env.vue'
|
import Env from './env.vue'
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ const setControls = () => {
|
||||||
controls.value.enabled = false;
|
controls.value.enabled = false;
|
||||||
targetDistance.max = raw_dataStore.data.max_distance;
|
targetDistance.max = raw_dataStore.data.max_distance;
|
||||||
targetDistance.min = mobileAndTabletCheck() ? raw_dataStore.data.min_distance * 0.5 : raw_dataStore.data.min_distance;
|
targetDistance.min = mobileAndTabletCheck() ? raw_dataStore.data.min_distance * 0.5 : raw_dataStore.data.min_distance;
|
||||||
// (controls.value as any).minDistance = mobileAndTabletCheck() ? raw_dataStore.data.min_distance * 0.5 : raw_dataStore.data.min_distance;
|
(controls.value as any).maxDistance = targetDistance.max;
|
||||||
(controls.value as any).maxDistance = raw_dataStore.data.max_distance;
|
(controls.value as any).minDistance = targetDistance.min;
|
||||||
|
|
||||||
const d = targetDistance.max * 0.5
|
const d = targetDistance.max * 0.5
|
||||||
camera.value?.position.set(d, d, d);
|
camera.value?.position.set(d, d, d);
|
||||||
|
@ -283,14 +283,14 @@ watch(() => sidebar.is_open && sidebar.id_clickable, () => {
|
||||||
((camera.value?.position as Vector3).z + target_vector.z) * 0.5,
|
((camera.value?.position as Vector3).z + target_vector.z) * 0.5,
|
||||||
)
|
)
|
||||||
lerp_vector.setComponent(1, d)
|
lerp_vector.setComponent(1, d)
|
||||||
const multiply = new Vector3(1.5, 1.5, 0)
|
// const multiply = new Vector3(1.5, 1.5, 0)
|
||||||
|
|
||||||
const target_move = target_vector.multiply(multiply)
|
const target_move = target_vector
|
||||||
const lerp_move = lerp_vector.multiply(multiply)
|
const lerp_move = lerp_vector
|
||||||
console.log({
|
// console.log({
|
||||||
target_vector,
|
// target_vector,
|
||||||
target_move
|
// target_move
|
||||||
})
|
// })
|
||||||
if (
|
if (
|
||||||
camera.value?.position && camera.value?.position.distanceTo(lerp_move) > d ||
|
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(target_move) > 10
|
||||||
|
@ -361,6 +361,10 @@ onBeforeRender(() => {
|
||||||
camera.value?.updateMatrixWorld()
|
camera.value?.updateMatrixWorld()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => targetDistance.min, () => {
|
||||||
|
(controls.value as any).minDistance = targetDistance.min;
|
||||||
|
})
|
||||||
|
|
||||||
const timer = useTimer()
|
const timer = useTimer()
|
||||||
timer.timer_func = () => {
|
timer.timer_func = () => {
|
||||||
if (timer.seconds_left == 0 && !(controls.value as any).autoRotate && (controls.value as any).enabled) {
|
if (timer.seconds_left == 0 && !(controls.value as any).autoRotate && (controls.value as any).enabled) {
|
||||||
|
|
Loading…
Reference in New Issue