fanLocal.three.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. import * as THREE from 'three';
  2. import { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';
  3. import { animateCamera, getTextCanvas, renderVideo, updateAxisCenter } from '/@/utils/threejs/util';
  4. import UseThree from '../../../../utils/threejs/useThree';
  5. import fcFan from './fcfanLocal.three';
  6. import fmFan from './fmfanLocal.three';
  7. import Smoke from '/@/views/vent/comment/threejs/Smoke';
  8. import gsap from 'gsap';
  9. import { useAppStore } from '/@/store/modules/app';
  10. // import * as dat from 'dat.gui';
  11. // const gui = new dat.GUI();
  12. // gui.domElement.style = 'position:absolute;top:100px;left:10px;z-index:99999999999999';
  13. const modelName = 'jbfj_hd';
  14. // 模型对象、 文字对象
  15. let model,
  16. group = new THREE.Object3D(),
  17. fcFanObj,
  18. fmFanObj,
  19. player1,
  20. fanType,
  21. topSmoke,
  22. downSmoke,
  23. playerStartClickTime1 = new Date().getTime(),
  24. playerStartClickTime2 = new Date().getTime();
  25. const appStore = useAppStore();
  26. // 打灯光
  27. const addLight = (scene) => {
  28. const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
  29. directionalLight.position.set(106, -348, 19.9);
  30. group.add(directionalLight);
  31. directionalLight.target = group;
  32. // gui.add(directionalLight.position, 'x', -1000, 1000);
  33. // gui.add(directionalLight.position, 'y', -1000, 1000);
  34. // gui.add(directionalLight.position, 'z', -1000, 1000);
  35. // const pointLight2 = new THREE.PointLight(0xffeeee, 1.5, 100);
  36. // pointLight2.position.set(-120, 16, -33);
  37. // pointLight2.shadow.bias = 0.05;
  38. // scene.add(pointLight2);
  39. //
  40. // const pointLight3 = new THREE.PointLight(0xffffff, 1, 40);
  41. // pointLight3.position.set(-66, 40, 1);
  42. // pointLight3.shadow.bias = 0.05;
  43. // scene.add(pointLight3);
  44. //
  45. // const pointLight4 = new THREE.PointLight(0xffeeee, 0.6, 230);
  46. // pointLight4.position.set(-18, 30, 12);
  47. // pointLight4.shadow.bias = 0.05;
  48. // scene.add(pointLight4);
  49. //
  50. // const pointLight5 = new THREE.PointLight(0xffffff, 0.8, 90);
  51. // pointLight5.position.set(-57, 7, -30);
  52. // pointLight5.shadow.bias = 0.05;
  53. // scene.add(pointLight5);
  54. //
  55. // const pointLight6 = new THREE.PointLight(0xffffff, 0.8, 270);
  56. // pointLight6.position.set(72, -33, 11.4);
  57. // pointLight6.shadow.bias = 0.05;
  58. // scene.add(pointLight6);
  59. // const pointLight7 = new THREE.PointLight(0xffffff, 0.8, 500);
  60. // pointLight7.position.set(-20, -43, 12);
  61. // pointLight7.shadow.bias = -0.05;
  62. // scene.add(pointLight7);
  63. const spotLight = new THREE.SpotLight();
  64. spotLight.angle = Math.PI / 16;
  65. spotLight.penumbra = 0;
  66. spotLight.castShadow = true;
  67. spotLight.position.set(0, 463, 687);
  68. scene.add(spotLight);
  69. spotLight.shadow.camera.near = 0.5; // default
  70. spotLight.shadow.camera.far = 1000; // default
  71. spotLight.shadow.focus = 1;
  72. spotLight.shadow.bias = -0.000002;
  73. spotLight.target = group;
  74. // gui.add(pointLight6.position, 'x', -200, 200);
  75. // gui.add(pointLight6.position, 'y', -200, 200);
  76. // gui.add(pointLight6.position, 'z', -200, 200);
  77. // gui.add(pointLight6, 'distance', 0, 500);
  78. };
  79. // 重置摄像头
  80. const resetCamera = () => {
  81. // model.camera.position.set(0, 30, 80);
  82. model.camera.position.set(0, -1000, 100);
  83. // model.camera.fov = 20
  84. model.camera.far = 1000;
  85. model.orbitControls?.update();
  86. model.camera.updateProjectionMatrix();
  87. };
  88. // 设置模型位置
  89. const setModalPosition = () => {
  90. group.position.set(0, 13, -50);
  91. group.rotation.y = Math.PI / 2;
  92. };
  93. const setControls = () => {
  94. model.orbitControls.panSpeed = 0.5;
  95. model.orbitControls.rotateSpeed = 0.5;
  96. model.orbitControls.maxPolarAngle = Math.PI / 2.4;
  97. model.orbitControls.minPolarAngle = Math.PI / 3;
  98. };
  99. // 切换局部通风机类型
  100. export const setModelType = (type) => {
  101. fanType = type;
  102. return new Promise((resolve) => {
  103. // 显示双道风窗
  104. if (fanType === 'fm') {
  105. if (group.getObjectByName('jbfj_fc')) {
  106. group.remove(fcFanObj.group);
  107. }
  108. setTimeout(async () => {
  109. const position = fmFanObj.group;
  110. const oldCameraPosition = { x: 500, y: 100, z: 500 };
  111. await animateCamera(
  112. oldCameraPosition,
  113. oldCameraPosition,
  114. { x: 0, y: 20, z: 80 },
  115. { x: position.x, y: position.y, z: position.z },
  116. model,
  117. 0.8
  118. );
  119. group.add(fmFanObj.group);
  120. resolve(null);
  121. }, 300);
  122. } else if (fanType === 'fc') {
  123. // 显示单道风窗
  124. if (group.getObjectByName('jbfj_fm')) {
  125. group.remove(fmFanObj.group);
  126. }
  127. setTimeout(async () => {
  128. const position = fcFanObj.group;
  129. const oldCameraPosition = { x: 500, y: 100, z: 500 };
  130. await animateCamera(
  131. oldCameraPosition,
  132. oldCameraPosition,
  133. { x: 0, y: 20, z: 80 },
  134. { x: position.x, y: position.y, z: position.z },
  135. model,
  136. 0.8
  137. );
  138. group.add(fcFanObj.group);
  139. resolve(null);
  140. }, 300);
  141. }
  142. });
  143. };
  144. /* 添加监控数据 */
  145. export const addText = (selectData) => {
  146. if (!group) {
  147. return;
  148. }
  149. const textArr = [
  150. {
  151. text: `煤矿巷道远程局部风机系统`,
  152. font: 'normal 30px Arial',
  153. color: '#009900',
  154. strokeStyle: '#002200',
  155. x: 50,
  156. y: 110,
  157. },
  158. {
  159. text: `进风量(m³/min):`,
  160. font: 'normal 30px Arial',
  161. color: '#009900',
  162. strokeStyle: '#002200',
  163. x: 0,
  164. y: 165,
  165. },
  166. {
  167. text: `${selectData.frontRearDP}`,
  168. font: 'normal 30px Arial',
  169. color: '#009900',
  170. strokeStyle: '#002200',
  171. x: 290,
  172. y: 165,
  173. },
  174. {
  175. text: `供风量(m³/min): `,
  176. font: 'normal 30px Arial',
  177. color: '#009900',
  178. strokeStyle: '#002200',
  179. x: 0,
  180. y: 220,
  181. },
  182. {
  183. text: ` ${selectData.sourcePressure}`,
  184. font: 'normal 30px Arial',
  185. color: '#009900',
  186. strokeStyle: '#002200',
  187. x: 280,
  188. y: 220,
  189. },
  190. {
  191. text: `故障诊断:`,
  192. font: 'normal 30px Arial',
  193. color: '#009900',
  194. strokeStyle: '#002200',
  195. x: 0,
  196. y: 275,
  197. },
  198. {
  199. text: `${selectData.fault}`,
  200. font: 'normal 30px Arial',
  201. color: '#009900',
  202. strokeStyle: '#002200',
  203. x: 280,
  204. y: 275,
  205. },
  206. {
  207. text: `煤炭科学技术研究院有限公司研制`,
  208. font: 'normal 28px Arial',
  209. color: '#009900',
  210. strokeStyle: '#002200',
  211. x: 20,
  212. y: 325,
  213. },
  214. ];
  215. getTextCanvas(526, 346, textArr, '').then((canvas: HTMLCanvasElement) => {
  216. const textMap = new THREE.CanvasTexture(canvas); // 关键一步
  217. const textMaterial = new THREE.MeshBasicMaterial({
  218. // 关于材质并未讲解 实操即可熟悉 这里是漫反射类似纸张的材质,对应的就有高光类似金属的材质.
  219. map: textMap, // 设置纹理贴图
  220. transparent: true,
  221. side: THREE.FrontSide, // 这里是双面渲染的意思
  222. });
  223. textMaterial.blending = THREE.CustomBlending;
  224. const monitorPlane = group.getObjectByName('monitorText');
  225. if (monitorPlane) {
  226. monitorPlane.material = textMaterial;
  227. } else {
  228. const planeGeometry = new THREE.PlaneGeometry(526, 346); // 平面3维几何体PlaneGeometry
  229. const planeMesh = new THREE.Mesh(planeGeometry, textMaterial);
  230. planeMesh.name = 'monitorText';
  231. planeMesh.scale.set(0.0135, 0.0135, 0.0135);
  232. planeMesh.rotation.y = -Math.PI / 2;
  233. planeMesh.position.set(-84.79, 0.82, 17.01);
  234. group.add(planeMesh);
  235. }
  236. });
  237. };
  238. // // css3D文字
  239. export const addCssText = () => {
  240. if (!group.getObjectByName('text1')) {
  241. const element = document.getElementById('inputBox') as HTMLElement;
  242. const fanLocalCSS3D = new CSS3DObject(element);
  243. fanLocalCSS3D.name = 'text1';
  244. fanLocalCSS3D.scale.set(0.04, 0.04, 0.04);
  245. fanLocalCSS3D.rotation.y = -Math.PI / 2;
  246. fanLocalCSS3D.position.set(-85.68, 5.97, -17.74);
  247. group.add(fanLocalCSS3D);
  248. }
  249. if (!group.getObjectByName('text2')) {
  250. const element = document.getElementById('outBox') as HTMLElement;
  251. const fanLocalCSS3D = new CSS3DObject(element);
  252. fanLocalCSS3D.name = 'text2';
  253. fanLocalCSS3D.scale.set(0.1, 0.1, 0.1);
  254. fanLocalCSS3D.rotation.y = -Math.PI / 2;
  255. fanLocalCSS3D.position.set(74.63, 13.54, 3.84);
  256. group.add(fanLocalCSS3D);
  257. }
  258. if (!group.getObjectByName('text3')) {
  259. const element = document.getElementById('returnBox') as HTMLElement;
  260. const fanLocalCSS3D = new CSS3DObject(element);
  261. fanLocalCSS3D.name = 'text3';
  262. fanLocalCSS3D.scale.set(0.1, 0.1, 0.1);
  263. fanLocalCSS3D.rotation.y = -Math.PI / 2;
  264. fanLocalCSS3D.position.set(35.28, 10.05, -37.23);
  265. group.add(fanLocalCSS3D);
  266. }
  267. if (!group.getObjectByName('text4')) {
  268. const element = document.getElementById('gateBox') as HTMLElement;
  269. if (element) {
  270. element.innerHTML = '';
  271. const fanLocalCSS3D = new CSS3DObject(element);
  272. fanLocalCSS3D.name = 'text4';
  273. fanLocalCSS3D.scale.set(0.04, 0.04, 0.04);
  274. fanLocalCSS3D.rotation.y = -Math.PI / 2;
  275. fanLocalCSS3D.position.set(-73.13, 8.44, -23.52);
  276. group.add(fanLocalCSS3D);
  277. }
  278. }
  279. if (!group.getObjectByName('text5')) {
  280. const element = document.getElementById('windownBox') as HTMLElement;
  281. if (element) {
  282. // element.innerHTML = '';
  283. const fanLocalCSS3D = new CSS3DObject(element);
  284. fanLocalCSS3D.name = 'text5';
  285. fanLocalCSS3D.scale.set(0.07, 0.07, 0.07);
  286. fanLocalCSS3D.rotation.y = -Math.PI / 2;
  287. fanLocalCSS3D.position.set(-28.44, 9.78, -40.42);
  288. group.add(fanLocalCSS3D);
  289. }
  290. }
  291. };
  292. export const playSmoke = (controlType, deviceType, frequency, state) => {
  293. if (frequency) {
  294. setSmokeFrequency(deviceType, frequency);
  295. }
  296. if (controlType === 'startSmoke') {
  297. runFly(deviceType, state);
  298. }
  299. };
  300. const initFly = () => {
  301. const topCurve = [
  302. {
  303. path0: new THREE.Vector3(-94.84, 2.359, 3.61),
  304. path1: new THREE.Vector3(-85.678, 2.359, 3.61),
  305. isSpread: true,
  306. spreadDirection: -1, //
  307. },
  308. {
  309. path0: new THREE.Vector3(-85.678, 2.352, 3.66),
  310. path1: new THREE.Vector3(-85.636, 2.353, -3.829),
  311. isSpread: false,
  312. spreadDirection: 0,
  313. },
  314. {
  315. path0: new THREE.Vector3(-85.636, 2.353, -3.829),
  316. path1: new THREE.Vector3(-85.636, 1.026, -5.881),
  317. isSpread: false,
  318. spreadDirection: 0,
  319. },
  320. {
  321. path0: new THREE.Vector3(-85.636, 1.026, -5.881),
  322. path1: new THREE.Vector3(-85.618, 0.887, -12.862),
  323. isSpread: false,
  324. spreadDirection: 0,
  325. },
  326. {
  327. path0: new THREE.Vector3(-85.618, 0.827, -12.962),
  328. path1: new THREE.Vector3(80.404, 0.827, -12.962),
  329. isSpread: false,
  330. spreadDirection: 0,
  331. },
  332. {
  333. path0: new THREE.Vector3(80.404, 0.827, -12.962),
  334. path1: new THREE.Vector3(93.164, 0.85, -12.962),
  335. isSpread: true,
  336. spreadDirection: 1, // 1是由小变大,-1是由大变小
  337. },
  338. ];
  339. const downCurve = [
  340. {
  341. path0: new THREE.Vector3(-94.84, -0.388, 3.61),
  342. path1: new THREE.Vector3(-85.678, -0.393, 3.61),
  343. isSpread: true,
  344. spreadDirection: -1, //
  345. },
  346. {
  347. path0: new THREE.Vector3(-85.678, -0.393, 3.275),
  348. path1: new THREE.Vector3(-85.636, -0.392, -3.829),
  349. isSpread: false,
  350. spreadDirection: 0,
  351. },
  352. {
  353. path0: new THREE.Vector3(-85.636, -0.392, -3.829),
  354. path1: new THREE.Vector3(-85.636, 0.926, -5.881),
  355. isSpread: false,
  356. spreadDirection: 0,
  357. },
  358. {
  359. path0: new THREE.Vector3(-85.636, 1.026, -5.881),
  360. path1: new THREE.Vector3(-85.618, 0.887, -12.862),
  361. isSpread: false,
  362. spreadDirection: 0,
  363. },
  364. {
  365. path0: new THREE.Vector3(-85.618, 0.887, -12.962),
  366. path1: new THREE.Vector3(80.404, 0.887, -12.962),
  367. isSpread: false,
  368. spreadDirection: 0,
  369. },
  370. {
  371. path0: new THREE.Vector3(80.404, 0.887, -12.962),
  372. path1: new THREE.Vector3(93.164, 0.91, -12.962),
  373. isSpread: true,
  374. spreadDirection: 1, // 1是由小变大,-1是由大变小
  375. },
  376. ];
  377. // const windowCurve = new THREE.CatmullRomCurve3([
  378. // new THREE.Vector3(83.479, 0.052, -16.487),
  379. // new THREE.Vector3(-90.436, 0.0, -16.32),
  380. // new THREE.Vector3(-90.712, 0.0, -16.395),
  381. // new THREE.Vector3(-90.77, 0.0, -16.663),
  382. // new THREE.Vector3(-90.77, 0.0, -36.015),
  383. // ]);
  384. // const gateCurve = new THREE.CatmullRomCurve3([
  385. // new THREE.Vector3(83.479, 0.052, -16.487),
  386. // new THREE.Vector3(-30.267, 0.013, -16.458),
  387. // new THREE.Vector3(-30.62, 0.013, -16.523),
  388. // new THREE.Vector3(-30.727, 0.013, -16.831),
  389. // new THREE.Vector3(-30.727, 0.013, -35.84),
  390. // ]);
  391. if (!topSmoke) {
  392. topSmoke = new Smoke('/model/img/texture-smoke.png', '#ffffff', 0, 0.8, 0.5, 400);
  393. topSmoke.setPath(topCurve);
  394. topSmoke.setPoints();
  395. group?.add(topSmoke.points);
  396. }
  397. if (!downSmoke) {
  398. downSmoke = new Smoke('/model/img/texture-smoke.png', '#ffffff', 0, 0.8, 0.5, 400);
  399. downSmoke.setPath(downCurve);
  400. downSmoke.setPoints();
  401. group?.add(downSmoke.points);
  402. }
  403. // if (!group.getObjectByName('gateFly')) {
  404. // }
  405. };
  406. const runFly = (deviceType, state) => {
  407. if (state === 'open') {
  408. if (deviceType === 'top') {
  409. if (downSmoke.frameId) {
  410. downSmoke.stopSmoke();
  411. }
  412. topSmoke.startSmoke();
  413. } else {
  414. if (topSmoke.frameId) {
  415. topSmoke.stopSmoke();
  416. }
  417. downSmoke.startSmoke();
  418. }
  419. } else {
  420. if (downSmoke.frameId) {
  421. downSmoke.stopSmoke();
  422. }
  423. if (topSmoke.frameId) {
  424. topSmoke.stopSmoke();
  425. }
  426. }
  427. };
  428. // 调频 30-50 (life 300 - 800) , 25 = (800 - 300)/ 20
  429. const setSmokeFrequency = (deviceType, frequency) => {
  430. const life = (frequency - 30) * 25;
  431. const duration = (Math.abs(life - topSmoke.life) / 500) * 25;
  432. let smoke;
  433. if (deviceType === 'top') {
  434. smoke = topSmoke;
  435. } else {
  436. smoke = downSmoke;
  437. }
  438. gsap.to(smoke, {
  439. life: life,
  440. duration: duration,
  441. ease: 'easeInCubic',
  442. overwrite: true,
  443. });
  444. };
  445. const clearFly = () => {
  446. if (topSmoke) topSmoke.clearSmoke();
  447. if (downSmoke) downSmoke.clearSmoke();
  448. };
  449. // 初始化事件
  450. const startAnimation = () => {
  451. // 定义鼠标点击事件
  452. model.canvasContainer?.addEventListener('mousedown', mouseEvent.bind(null));
  453. model.canvasContainer?.addEventListener('pointerup', (event) => {
  454. event.stopPropagation();
  455. });
  456. };
  457. // 鼠标点击、松开事件
  458. const mouseEvent = (event) => {
  459. const factor = 3;
  460. event.stopPropagation();
  461. const widthScale = appStore.getWidthScale;
  462. const heightScale = appStore.getHeightScale;
  463. // 将鼠标位置归一化为设备坐标。x 和 y 方向的取值范围是 (-1 to +1)
  464. model.mouse.x =
  465. ((-model.canvasContainer.getBoundingClientRect().left * widthScale + event.clientX) / (model.canvasContainer.clientWidth * widthScale)) * 2 - 1;
  466. model.mouse.y =
  467. -((-model.canvasContainer.getBoundingClientRect().top + event.clientY) / (model.canvasContainer.clientHeight * heightScale)) * 2 + 1;
  468. // model.orbitControls.target.set()
  469. (model.rayCaster as THREE.Raycaster).setFromCamera(model.mouse, model.camera as THREE.Camera);
  470. updateAxisCenter(model, event);
  471. if (group) {
  472. const intersects = model.rayCaster?.intersectObjects(group.children, false) as THREE.Intersection[];
  473. if (intersects.length > 0) {
  474. intersects.find((intersect) => {
  475. const mesh = intersect.object;
  476. if (mesh.name === 'player1') {
  477. if (new Date().getTime() - playerStartClickTime1 < 400) {
  478. // 双击,视频放大
  479. if (player1) {
  480. player1.requestFullscreen();
  481. }
  482. }
  483. playerStartClickTime1 = new Date().getTime();
  484. return true;
  485. }
  486. });
  487. }
  488. }
  489. };
  490. export const mountedThree = (playerVal1) => {
  491. player1 = playerVal1;
  492. return new Promise((resolve) => {
  493. model = new UseThree('#fanLocal3D', '#fanLocal3DCSS');
  494. model.setEnvMap('test1');
  495. model.renderer.toneMappingExposure = 1;
  496. resetCamera();
  497. model.setModel([modelName]).then(async (gltf) => {
  498. group = gltf[0];
  499. model.scene?.add(group);
  500. setModalPosition();
  501. setControls();
  502. initFly();
  503. model.animate();
  504. addLight(model.scene);
  505. fcFanObj = new fcFan(model);
  506. await fcFanObj.mountedThree();
  507. fmFanObj = new fmFan(model);
  508. await fmFanObj.mountedThree();
  509. const videoPlayer1 = document.getElementById('jb-player1')?.getElementsByClassName('vjs-tech')[0];
  510. if (videoPlayer1) {
  511. const mesh = renderVideo(group, videoPlayer1, 'player1');
  512. mesh.scale.set(0.222, 0.19, 0.2);
  513. mesh.position.set(-84.87, 0.298, 24.76);
  514. mesh.rotation.y = -Math.PI / 2;
  515. group.add(mesh);
  516. } else {
  517. const textArr = [
  518. {
  519. text: `无信号输入`,
  520. font: 'normal 40px Arial',
  521. color: '#009900',
  522. strokeStyle: '#002200',
  523. x: 170,
  524. y: 40,
  525. },
  526. ];
  527. getTextCanvas(560, 346, textArr, '').then((canvas: HTMLCanvasElement) => {
  528. const textMap = new THREE.CanvasTexture(canvas); // 关键一步
  529. const textMaterial = new THREE.MeshBasicMaterial({
  530. map: textMap, // 设置纹理贴图
  531. transparent: true,
  532. side: THREE.DoubleSide, // 这里是双面渲染的意思
  533. });
  534. textMaterial.blending = THREE.CustomBlending;
  535. const monitorPlane = group?.getObjectByName('noPlayer');
  536. if (monitorPlane) {
  537. monitorPlane.material = textMaterial;
  538. } else {
  539. const planeGeometry = new THREE.PlaneGeometry(100, 100); // 平面3维几何体PlaneGeometry
  540. const planeMesh = new THREE.Mesh(planeGeometry, textMaterial);
  541. if (!videoPlayer1) {
  542. planeMesh.name = 'noPlayer';
  543. planeMesh.scale.set(0.07, 0.05, 0.07);
  544. planeMesh.position.set(-84.82, -1.53, 24.94);
  545. planeMesh.rotation.y = -Math.PI / 2;
  546. group?.add(planeMesh.clone());
  547. }
  548. }
  549. });
  550. }
  551. startAnimation();
  552. resolve(model);
  553. });
  554. });
  555. };
  556. export const destroy = () => {
  557. if (model) {
  558. clearFly();
  559. if (fcFanObj) fcFanObj.destroy();
  560. if (fmFanObj) fmFanObj.destroy();
  561. model.deleteModal();
  562. model = null;
  563. group = null;
  564. topSmoke = null;
  565. downSmoke = null;
  566. }
  567. };