|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader'
|
|
|
|
|
import { MTLLoader } from 'three/examples/jsm/loaders/MTLLoader'
|
|
|
|
|
import {
|
|
|
|
|
isLoading,
|
|
|
|
|
tuopanLocation,
|
|
|
|
|
tishengjiLocation, keyidongModel, storeyHeight, tuopanModel, animationLine, storeyWidth
|
|
|
|
|
} from './setThree'
|
|
|
|
@ -136,25 +137,6 @@ const tuopanYAnimation = (model, floor, newLocation = 0, time = 2000) => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
if (animationLine.length < 5) {
|
|
|
|
|
|
|
|
|
|
let floor = Math.ceil(Math.random() * 5)
|
|
|
|
|
|
|
|
|
|
animationLine.push(() => {
|
|
|
|
|
if (tuopanInishengji) {
|
|
|
|
|
return Promise.all([tishengjiAnimation(keyidongModel, floor, storeyHeight[floor]), tuopanYAnimation(tuopanModel, floor, storeyHeight[floor])])
|
|
|
|
|
} else {
|
|
|
|
|
animationLine.push(() => tishengjiAnimation(keyidongModel, floor, storeyHeight[floor]))
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (Math.random() > 0.5) {
|
|
|
|
|
animationLine.push(() => tuopanXAnimation(tuopanModel, storeyWidth[floor]))
|
|
|
|
|
animationLine.push(() => tuopanXAnimation(tuopanModel, 0))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, 1800)
|
|
|
|
|
|
|
|
|
|
const addtuopan = (params) => {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
try {
|
|
|
|
@ -188,6 +170,28 @@ const addtuopan = (params) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
if (isLoading) {
|
|
|
|
|
|
|
|
|
|
if (animationLine.length < 5) {
|
|
|
|
|
|
|
|
|
|
let floor = Math.ceil(Math.random() * 5)
|
|
|
|
|
|
|
|
|
|
animationLine.push(() => {
|
|
|
|
|
if (tuopanInishengji) {
|
|
|
|
|
return Promise.all([tishengjiAnimation(keyidongModel, floor, storeyHeight[floor]), tuopanYAnimation(tuopanModel, floor, storeyHeight[floor])])
|
|
|
|
|
} else {
|
|
|
|
|
animationLine.push(() => tishengjiAnimation(keyidongModel, floor, storeyHeight[floor]))
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (Math.random() > 0.5) {
|
|
|
|
|
animationLine.push(() => tuopanXAnimation(tuopanModel, storeyWidth[floor]))
|
|
|
|
|
animationLine.push(() => tuopanXAnimation(tuopanModel, 0))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, 1800)
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
tuopanInishengji,
|
|
|
|
|
tishengjiAnimation,
|
|
|
|
|