dev #60

Merged
ksenia_mikhailova merged 48 commits from dev into main 2024-07-26 10:41:38 +03:00
1 changed files with 22 additions and 22 deletions
Showing only changes of commit 091f24b097 - Show all commits

View File

@ -25,7 +25,10 @@ const axis = [
{ axis: 'z', func: 'translateZ', }, { axis: 'z', func: 'translateZ', },
] ]
type vectorType = 'x' | 'y' | 'z'; type vectorType = 'x' | 'y' | 'z';
const expFunc = (element: typeof axis[0]) => {
onLoop(() => {
if (model.value && target.value) {
axis.forEach(element => {
if (target.value) { if (target.value) {
const point = model.value.position[element.axis] const point = model.value.position[element.axis]
let step = stepbase * target.value[element.axis as vectorType] let step = stepbase * target.value[element.axis as vectorType]
@ -37,19 +40,16 @@ const expFunc = (element: typeof axis[0]) => {
try { try {
model.value[element.func](step) model.value[element.func](step)
} catch (error) { } catch (error) {
expFunc(element) console.log('lvl 1')
try { model.value[element.func](step) } catch {
console.log('lvl 2')
try { model.value[element.func](step) } catch {
console.log('lvl 3')
}
} }
} }
} }
} }
}
onLoop(() => {
if (model.value && target.value) {
axis.forEach(element => {
try {
expFunc(element)
} catch (error) {
console.log(error)
} }
}); });
} }