|
@@ -9,6 +9,7 @@ let model,
|
|
|
fireDoor, //液压风门
|
|
fireDoor, //液压风门
|
|
|
fireDoorF, //保德风门
|
|
fireDoorF, //保德风门
|
|
|
fireDoorSsl, // 思山岭防火门
|
|
fireDoorSsl, // 思山岭防火门
|
|
|
|
|
+ fireDoorYmh, // 思山岭防火门
|
|
|
fireDoorRed, // 防火门
|
|
fireDoorRed, // 防火门
|
|
|
group: THREE.Object3D,
|
|
group: THREE.Object3D,
|
|
|
fhmType = '';
|
|
fhmType = '';
|
|
@@ -31,6 +32,9 @@ const startAnimation = () => {
|
|
|
if (fhmType === 'fireDoorSsl') {
|
|
if (fhmType === 'fireDoorSsl') {
|
|
|
fireDoorSsl?.mouseUpModel.call(fireDoorSsl);
|
|
fireDoorSsl?.mouseUpModel.call(fireDoorSsl);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (fhmType === 'fireDoorYmh') {
|
|
|
|
|
+ fireDoorYmh?.mouseUpModel.call(fireDoorYmh);
|
|
|
|
|
+ }
|
|
|
if (fhmType === 'fireDoorRed') {
|
|
if (fhmType === 'fireDoorRed') {
|
|
|
fireDoorRed?.mouseUpModel.call(fireDoorRed);
|
|
fireDoorRed?.mouseUpModel.call(fireDoorRed);
|
|
|
}
|
|
}
|
|
@@ -50,6 +54,9 @@ const mouseEvent = (event) => {
|
|
|
if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
|
fireDoorSsl?.mousedownModel.call(fireDoorSsl, intersects);
|
|
fireDoorSsl?.mousedownModel.call(fireDoorSsl, intersects);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (fhmType === 'fireDoorYmh' && fireDoorYmh) {
|
|
|
|
|
+ fireDoorYmh?.mousedownModel.call(fireDoorYmh, intersects);
|
|
|
|
|
+ }
|
|
|
if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
|
fireDoorRed?.mousedownModel.call(fireDoorRed, intersects);
|
|
fireDoorRed?.mousedownModel.call(fireDoorRed, intersects);
|
|
|
}
|
|
}
|
|
@@ -68,6 +75,9 @@ export const play = (handlerState, flag?) => {
|
|
|
if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
|
return fireDoorSsl.play.call(fireDoorSsl, handlerState, flag);
|
|
return fireDoorSsl.play.call(fireDoorSsl, handlerState, flag);
|
|
|
}
|
|
}
|
|
|
|
|
+ if (fhmType === 'fireDoorYmh' && fireDoorYmh) {
|
|
|
|
|
+ return fireDoorYmh.play.call(fireDoorYmh, handlerState, flag);
|
|
|
|
|
+ }
|
|
|
if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
|
return fireDoorRed.play.call(fireDoorRed, handlerState, flag);
|
|
return fireDoorRed.play.call(fireDoorRed, handlerState, flag);
|
|
|
}
|
|
}
|
|
@@ -85,6 +95,9 @@ export const setModelType = (type) => {
|
|
|
if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
|
fireDoorSsl.resetAnimate();
|
|
fireDoorSsl.resetAnimate();
|
|
|
}
|
|
}
|
|
|
|
|
+ if (fhmType === 'fireDoorYmh' && fireDoorYmh) {
|
|
|
|
|
+ fireDoorYmh.resetAnimate();
|
|
|
|
|
+ }
|
|
|
if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
|
fireDoorRed.resetAnimate();
|
|
fireDoorRed.resetAnimate();
|
|
|
}
|
|
}
|
|
@@ -108,6 +121,12 @@ export const setModelType = (type) => {
|
|
|
newP: { x: 342.74781900192056, y: 183.50210411099545, z: 451.0806333923029 },
|
|
newP: { x: 342.74781900192056, y: 183.50210411099545, z: 451.0806333923029 },
|
|
|
newT: { x: 72.33938301176254, y: -35.03891296652319, z: -37.91742549963208 },
|
|
newT: { x: 72.33938301176254, y: -35.03891296652319, z: -37.91742549963208 },
|
|
|
},
|
|
},
|
|
|
|
|
+ fireDoorYmh: {
|
|
|
|
|
+ render: fireDoorYmh ? () => fireDoorYmh.render() : null,
|
|
|
|
|
+ group: fireDoorYmh ? fireDoorYmh.group : null,
|
|
|
|
|
+ newP: { x: 342.74781900192056, y: 183.50210411099545, z: 451.0806333923029 },
|
|
|
|
|
+ newT: { x: 72.33938301176254, y: -35.03891296652319, z: -37.91742549963208 },
|
|
|
|
|
+ },
|
|
|
fireDoorRed: {
|
|
fireDoorRed: {
|
|
|
render: fireDoorRed ? () => fireDoorRed.render() : null,
|
|
render: fireDoorRed ? () => fireDoorRed.render() : null,
|
|
|
group: fireDoorRed ? fireDoorRed.group : null,
|
|
group: fireDoorRed ? fireDoorRed.group : null,
|
|
@@ -126,7 +145,7 @@ export const setModelType = (type) => {
|
|
|
model.orbitControls.minDistance = 600;
|
|
model.orbitControls.minDistance = 600;
|
|
|
model.orbitControls.maxDistance = 900;
|
|
model.orbitControls.maxDistance = 900;
|
|
|
model.orbitControls.update();
|
|
model.orbitControls.update();
|
|
|
- } else if (type == 'fireDoorRed' || type == 'fireDoorSsl') {
|
|
|
|
|
|
|
+ } else if (type == 'fireDoorRed' || type == 'fireDoorSsl' || type == 'fireDoorYmh') {
|
|
|
model.orbitControls.maxPolarAngle = Math.PI;
|
|
model.orbitControls.maxPolarAngle = Math.PI;
|
|
|
model.orbitControls.minPolarAngle = 0;
|
|
model.orbitControls.minPolarAngle = 0;
|
|
|
model.orbitControls.enableRotate = true;
|
|
model.orbitControls.enableRotate = true;
|
|
@@ -163,6 +182,8 @@ export const initCameraCanvas = async (playerVal1) => {
|
|
|
return await fireDoorF.initCamera.call(fireDoorF, playerVal1);
|
|
return await fireDoorF.initCamera.call(fireDoorF, playerVal1);
|
|
|
} else if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
} else if (fhmType === 'fireDoorSsl' && fireDoorSsl) {
|
|
|
return await fireDoorSsl.initCamera.call(fireDoorSsl, playerVal1);
|
|
return await fireDoorSsl.initCamera.call(fireDoorSsl, playerVal1);
|
|
|
|
|
+ } else if (fhmType === 'fireDoorYmh' && fireDoorYmh) {
|
|
|
|
|
+ return await fireDoorYmh.initCamera.call(fireDoorYmh, playerVal1);
|
|
|
} else if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
} else if (fhmType === 'fireDoorRed' && fireDoorRed) {
|
|
|
return await fireDoorRed.initCamera.call(fireDoorRed, playerVal1);
|
|
return await fireDoorRed.initCamera.call(fireDoorRed, playerVal1);
|
|
|
}
|
|
}
|
|
@@ -172,6 +193,7 @@ const loadModel = (code): Promise<any> => {
|
|
|
if (code === 'fireDoor') return import('./fireDoor.threejs.fire').then((r) => r.default);
|
|
if (code === 'fireDoor') return import('./fireDoor.threejs.fire').then((r) => r.default);
|
|
|
if (code === 'fireDoorF') return import('./fireDoor.threejs.fireF').then((r) => r.default);
|
|
if (code === 'fireDoorF') return import('./fireDoor.threejs.fireF').then((r) => r.default);
|
|
|
if (code === 'fireDoorSsl') return import('./fireDoor.threejs.ssl').then((r) => r.default);
|
|
if (code === 'fireDoorSsl') return import('./fireDoor.threejs.ssl').then((r) => r.default);
|
|
|
|
|
+ if (code === 'fireDoorYmh') return import('./fireDoor.threejs.ymh').then((r) => r.default);
|
|
|
if (code === 'fireDoorRed') return import('./fireDoor.threejs.fire.redGate').then((r) => r.default);
|
|
if (code === 'fireDoorRed') return import('./fireDoor.threejs.fire.redGate').then((r) => r.default);
|
|
|
return import('./fireDoor.threejs.fire.redGate').then((r) => r.default);
|
|
return import('./fireDoor.threejs.fire.redGate').then((r) => r.default);
|
|
|
};
|
|
};
|
|
@@ -202,6 +224,11 @@ export const mountedThree = () => {
|
|
|
fireDoorSsl = new FireDoorSsl(model);
|
|
fireDoorSsl = new FireDoorSsl(model);
|
|
|
fireDoorSsl.mountedThree();
|
|
fireDoorSsl.mountedThree();
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case 'fireDoorYmh':
|
|
|
|
|
+ const FireDoorYmh = await loadModel('fireDoorYmh');
|
|
|
|
|
+ fireDoorYmh = new FireDoorYmh(model);
|
|
|
|
|
+ fireDoorYmh.mountedThree();
|
|
|
|
|
+ break;
|
|
|
case 'fireDoorRed':
|
|
case 'fireDoorRed':
|
|
|
const FireDoorRed = await loadModel('fireDoorRed');
|
|
const FireDoorRed = await loadModel('fireDoorRed');
|
|
|
fireDoorRed = new FireDoorRed(model);
|
|
fireDoorRed = new FireDoorRed(model);
|
|
@@ -236,6 +263,8 @@ export const destroy = () => {
|
|
|
fireDoorF = null;
|
|
fireDoorF = null;
|
|
|
if (fireDoorSsl) fireDoorSsl.destroy();
|
|
if (fireDoorSsl) fireDoorSsl.destroy();
|
|
|
fireDoorSsl = null;
|
|
fireDoorSsl = null;
|
|
|
|
|
+ if (fireDoorYmh) fireDoorYmh.destroy();
|
|
|
|
|
+ fireDoorYmh = null;
|
|
|
if (fireDoorRed) fireDoorRed.destroy();
|
|
if (fireDoorRed) fireDoorRed.destroy();
|
|
|
fireDoorRed = null;
|
|
fireDoorRed = null;
|
|
|
// @ts-ignore-next-line
|
|
// @ts-ignore-next-line
|