3 lvl depth
This commit is contained in:
parent
017e37d5e3
commit
091f24b097
|
@ -25,7 +25,10 @@ const axis = [
|
|||
{ axis: 'z', func: 'translateZ', },
|
||||
]
|
||||
type vectorType = 'x' | 'y' | 'z';
|
||||
const expFunc = (element: typeof axis[0]) => {
|
||||
|
||||
onLoop(() => {
|
||||
if (model.value && target.value) {
|
||||
axis.forEach(element => {
|
||||
if (target.value) {
|
||||
const point = model.value.position[element.axis]
|
||||
let step = stepbase * target.value[element.axis as vectorType]
|
||||
|
@ -37,19 +40,16 @@ const expFunc = (element: typeof axis[0]) => {
|
|||
try {
|
||||
model.value[element.func](step)
|
||||
} 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