dev #60
|
@ -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)
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue