ThreeWorldEventMainQingXiCheAndQv.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <script setup>
  2. import { watch } from "vue";
  3. import { CommonVal } from "@/components/ChengGuangYuanJing/store/CommonVal.js";
  4. import { QingXiCheAndQvMyThreeWorldStore } from "./store/QingXiCheAndQvMyThreeWorldStore.js";
  5. import ThreeWorldQingXiCheAndQv from "./ThreeWorldQingXiCheAndQv.vue";
  6. import { QingXiCheAndQvThreeWorldEventMain } from "./js/QingXiCheAndQvThreeWorldEventMain.js";
  7. import { QingXiCheAndQvCarEvent } from "./js/QingXiCheAndQvCarEvent.js";
  8. import { QingXiCheAndQvCarEventClick } from "./js/QingXiCheAndQvCarEventClick.js";
  9. import { QingXiCheAndQvComHighlightLayer } from "./js/QingXiCheAndQvComHighlightLayer.js";
  10. import { QingXiCheAndQvThreeWorldCamera } from "./js/QingXiCheAndQvThreeWorldCamera.js";
  11. import { WindowTxtStore } from "@/components/WindowQingXiCheAndQv/store/WindowTxtStore.js";
  12. import { WindowVideoStore } from "@/components/WindowQingXiCheAndQv/store/WindowVideoStore.js";
  13. import { WindowCountdownStore } from "@/components/WindowQingXiCheAndQv/store/WindowCountdownStore.js";
  14. import { WindowMenuStore } from "@/components/WindowQingXiCheAndQv/store/WindowMenuStore.js";
  15. import { ComMusic } from "../../utils/common/ComMusic.js";
  16. import { QingXiCheAndQvComRes } from "./js/QingXiCheAndQvComRes.js";
  17. import { WindowEvent } from "../WindowQingXiCheAndQv/js/WindowEvent.js";
  18. import { WindowVideoRemoveColorStore } from "@/components/WindowQingXiCheAndQv/store/WindowVideoRemoveColorStore.js";
  19. import { QingXiCheAndQvComClipPlaneMeshEvent } from "./js/QingXiCheAndQvComClipPlaneMeshEvent.js";
  20. import { QingXiCheAdnQvCarEventStep } from "./js/QingXiCheAdnQvCarEventStep.js";
  21. import { QingXiCheAndQvProcessEventStore } from "./event/store/QingXiCheAndQvProcessEventStore.js";
  22. import { CommonGuiDbListTwo } from "../../utils/common/CommonGuiDbListTwo.js";
  23. /**
  24. * 平时开发3d代码逻辑可以写这里
  25. * 更多的代码逻辑,建议用面向对象的方式去开发
  26. * 不然后面的逻辑会越来越复杂
  27. */
  28. /**
  29. * 举个例子,我们oss文件上传了,编辑器打包后的代码
  30. * 地址为 https://**.com/3dmodel/index.html
  31. *
  32. * 我们将对应的项目的3d模型,在了同域的地址是
  33. * https://**.com/自定义目录1/自定义目录2/model/
  34. *
  35. */
  36. // // 拼接出进入3d场景的地址,用于后续发布
  37. // let threeWorldUrl = "https://**.com/3dmodel/index.html#/main?id=zidingyi&user=zidingyi"
  38. // + '&commonconfig=https://**.com/自定义目录1/自定义目录2/model/'
  39. // + '&commonmodel=https://**.com/自定义目录1/自定义目录2/model/';
  40. // /**
  41. // * 本地开发调试固定地址
  42. // */
  43. // let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi";
  44. // let commonconfig = "http://localhost:5173/3dMain/model_water_car_3/";
  45. // let commonmodel = "http://localhost:5173/3dMain/model_water_car_3/";
  46. // let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi_lu_cun&user=zidingyi"
  47. // + '&commonconfig=' + commonconfig
  48. // + '&commonmodel=' + commonmodel;
  49. // let commonconfig = "https://www.3dyzt.com/waterMaintenance/3dMain/model_water_car_3/";
  50. // let commonmodel = "https://www.3dyzt.com/waterMaintenance/3dMain/model_water_car_3/";
  51. // let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi_lu_cun&user=zidingyi"
  52. // + '&commonconfig=' + commonconfig
  53. // + '&commonmodel=' + commonmodel;
  54. // let hostUrl = import.meta.env.VITE_THREE_WORLD_URL;
  55. // let commonconfig = hostUrl + "/3dMain/model_water_car_6/";
  56. // let commonmodel = hostUrl + "/3dMain/model_water_car_6/";
  57. // let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi_lu_cun&user=zidingyi"
  58. // + '&commonconfig=' + commonconfig
  59. // + '&commonmodel=' + commonmodel;
  60. // let hostUrl = import.meta.env.VITE_THREE_WORLD_URL;
  61. // let commonconfig = hostUrl + "/3dMain/model_water_car_7/";
  62. // let commonmodel = hostUrl + "/3dMain/model_water_car_7/";
  63. // let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi_lu_cun&user=zidingyi"
  64. // + '&commonconfig=' + commonconfig
  65. // + '&commonmodel=' + commonmodel;
  66. let hostUrl = import.meta.env.VITE_THREE_WORLD_URL;
  67. let commonconfig = hostUrl + "/3dMain/model_water_car_8/";
  68. let commonmodel = hostUrl + "/3dMain/model_water_car_8/";
  69. let threeWorldUrl = "3dMain/index.html#/main?id=zidingyi_lu_cun&user=zidingyi"
  70. + '&commonconfig=' + commonconfig
  71. + '&commonmodel=' + commonmodel;
  72. /**
  73. * 回调加载百分比
  74. */
  75. const callbackLoadPercentageEvent = (json) => {
  76. // console.log("回调加载百分比", json);
  77. let loadPercentage = parseFloat(json["loadPercentage"]);
  78. if (loadPercentage == null || loadPercentage == undefined || loadPercentage < 0) {
  79. loadPercentage = 0;
  80. }
  81. QingXiCheAndQvMyThreeWorldStore().loadPercentage = loadPercentage;
  82. // 加载小于百分比
  83. if (loadPercentage < 100) {
  84. // ##############################【这里只做控制】隐藏其他按钮界面等
  85. CommonVal().loadSuccess = false;
  86. return;
  87. }
  88. }
  89. /**
  90. * 回调加载完成
  91. */
  92. const callbackLoadEndEvent = (json) => {
  93. // console.log("回调加载完成", json);
  94. QingXiCheAndQvMyThreeWorldStore().loadPercentage = 100;
  95. // 此时是显示角色的界面
  96. if (json["roleChoiceOpenBool"] === true) {
  97. // ############################## 隐藏其他按钮界面等
  98. CommonVal().loadSuccess = false;
  99. return;
  100. }
  101. // ############################## 这个时候,是真正的进入3d画面了,才显示其他按钮界面等
  102. CommonVal().loadSuccess = true;
  103. // 初始化操作3d的类对象,后续代码在这里面操作
  104. QingXiCheAndQvThreeWorldEventMain.find().initObj(
  105. CommonVal().obj.CommonValQingXiCheAndQv,
  106. CommonVal().obj.CommonValQingXiCheAndQv.objIframe,
  107. CommonVal().obj.CommonValQingXiCheAndQv.objIframe.ChengGuangYuanJing.CommonVal.find().objScene,
  108. CommonVal().obj.CommonValQingXiCheAndQv.objIframe.BABYLON
  109. );
  110. QingXiCheAndQvComHighlightLayer.find().init(
  111. QingXiCheAndQvThreeWorldEventMain.find()
  112. );
  113. QingXiCheAndQvThreeWorldCamera.find().initObj(
  114. CommonVal().obj.CommonValQingXiCheAndQv,
  115. CommonVal().obj.CommonValQingXiCheAndQv.objIframe,
  116. CommonVal().obj.CommonValQingXiCheAndQv.objIframe.ChengGuangYuanJing.CommonVal.find().objScene,
  117. CommonVal().obj.CommonValQingXiCheAndQv.objIframe.BABYLON
  118. );
  119. QingXiCheAndQvThreeWorldCamera.find().addConfig();
  120. QingXiCheAndQvCarEvent.find().objThreeWorldEventMain = QingXiCheAndQvThreeWorldEventMain.find();
  121. QingXiCheAndQvCarEventClick.find().objThreeWorldEventMain = QingXiCheAndQvThreeWorldEventMain.find();
  122. QingXiCheAndQvCarEventClick.find().QingXiCheAndQvProcessEventStore = QingXiCheAndQvProcessEventStore();
  123. QingXiCheAndQvComClipPlaneMeshEvent.find().objThreeWorldEventMain = QingXiCheAndQvThreeWorldEventMain.find();
  124. QingXiCheAndQvComClipPlaneMeshEvent.find().updateConfig();
  125. QingXiCheAdnQvCarEventStep.find().objThreeWorldEventMain = QingXiCheAndQvThreeWorldEventMain.find();
  126. // 新增被操作的 Store
  127. QingXiCheAndQvCarEvent.find().ComStore["WindowTxtStore"] = WindowTxtStore;
  128. QingXiCheAndQvCarEvent.find().ComStore["WindowVideoStore"] = WindowVideoStore;
  129. QingXiCheAndQvCarEvent.find().ComStore["WindowCountdownStore"] = WindowCountdownStore;
  130. QingXiCheAndQvCarEvent.find().ComStore["WindowMenuStore"] = WindowMenuStore;
  131. WindowEvent.find().ComStore["WindowTxtStore"] = WindowTxtStore;
  132. WindowEvent.find().ComStore["WindowVideoStore"] = WindowVideoStore;
  133. WindowEvent.find().ComStore["WindowCountdownStore"] = WindowCountdownStore;
  134. WindowEvent.find().ComStore["WindowVideoRemoveColorStore"] = WindowVideoRemoveColorStore;
  135. WindowEvent.find().ComStore["WindowMenuStore"] = WindowMenuStore;
  136. // 初始化GUI会用到的对象
  137. CommonGuiDbListTwo.find().objScene = CommonVal().obj.CommonValQingXiCheAndQv.objIframe.ChengGuangYuanJing.CommonVal.find().objScene;
  138. CommonGuiDbListTwo.find().objEngine = CommonVal().obj.CommonValQingXiCheAndQv.objIframe.ChengGuangYuanJing.CommonVal.find().objEngine;
  139. CommonGuiDbListTwo.find().BABYLON = CommonVal().obj.CommonValQingXiCheAndQv.objIframe.BABYLON;
  140. // 配置自定义背景图
  141. CommonGuiDbListTwo.find().bgImgConfig = {
  142. "url" : new URL("../../utils/common/bg.webp", import.meta.url).href,
  143. "width" : 409,
  144. "height" : 304,
  145. }
  146. // console.log(
  147. // "三维场景初始化 ==========",
  148. // CommonGuiDbListTwo.find().bgImgConfig,
  149. // CommonVal().obj.CommonValQingXiCheAndQv.objIframe.ChengGuangYuanJing.CommonVal.find().objEngine
  150. // );
  151. configMusicEvent();
  152. configVideoEvent();
  153. setTimeout(function() {
  154. QingXiCheAndQvCarEvent.find().evnetInit_1();
  155. // QingXiCheAndQvThreeWorldEventMain.find().toFlyModel();
  156. QingXiCheAndQvThreeWorldEventMain.find().groundNoRemove();
  157. // QingXiCheAndQvThreeWorldEventMain.find().eyeNameLook("实验");
  158. // 自动触发模拟点击,解决加载完成后,在点击下,重新设置了材质,感觉会有问题
  159. CommonVal().obj.CommonValQingXiCheAndQv.objIframe.ChengGuangYuanJing.CommonVal.find().screenClickNumEvent();
  160. }, 1000);
  161. // }, 300);
  162. }
  163. /**
  164. * 配置用到的声音文件
  165. */
  166. const configMusicEvent = () => {
  167. ComMusic.find().codeJson["lightningOne"] = new URL("../../assets/res/music/lightningOne.mp3", import.meta.url).href;
  168. ComMusic.find().codeJson["lightningTwo"] = new URL("../../assets/res/music/lightningTwo.mp3", import.meta.url).href;
  169. ComMusic.find().codeJson["lightningThree"] = new URL("../../assets/res/music/lightningThree.mp3", import.meta.url).href;
  170. // ComMusic.find().play("lightningThree");
  171. }
  172. /**
  173. * 配置用到的视频地址文件 等其他文件
  174. */
  175. const configVideoEvent = () => {
  176. QingXiCheAndQvCarEvent.find().videoJson["02"] = new URL("../../assets/res/video/02.mp4", import.meta.url).href;
  177. QingXiCheAndQvCarEvent.find().videoJson["03"] = new URL("../../assets/res/video/03.mp4", import.meta.url).href;
  178. QingXiCheAndQvCarEvent.find().videoJson["04"] = new URL("../../assets/res/video/04.mp4", import.meta.url).href;
  179. QingXiCheAndQvCarEvent.find().videoJson["videw_liu_cheng_1"] = new URL("../../assets/res/video/videw_liu_cheng_1.mp4", import.meta.url).href;
  180. QingXiCheAndQvCarEvent.find().videoJson["videw_liu_cheng_2"] = new URL("../../assets/res/video/videw_liu_cheng_2.mp4", import.meta.url).href;
  181. QingXiCheAndQvComRes.find().resJson["img_shuang"] = new URL("../../assets/res/img/texture/shuang_shan.jpg", import.meta.url).href;
  182. // 打开车辆双闪,同时开启工作双闪灯
  183. QingXiCheAndQvComRes.find().resJson["QingXiChe_01"] = new URL("../../assets/res/mp4/01.mp4", import.meta.url).href;
  184. // 按下取力器开关
  185. QingXiCheAndQvComRes.find().resJson["QingXiChe_02"] = new URL("../../assets/res/mp4/02.mp4", import.meta.url).href;
  186. // 从水管固定座上拧下高压水管
  187. QingXiCheAndQvComRes.find().resJson["QingXiChe_03"] = new URL("../../assets/res/mp4/03.mp4", import.meta.url).href;
  188. // 确认手刹已拉起,档位是空档,然后发动车辆
  189. QingXiCheAndQvComRes.find().resJson["QingXiChe_04"] = new URL("../../assets/res/mp4/04.mp4", import.meta.url).href;
  190. // 取出高压水管并放入布管器内
  191. QingXiCheAndQvComRes.find().resJson["QingXiChe_05"] = new URL("../../assets/res/mp4/05.mp4", import.meta.url).href;
  192. // 在触屏操作面板上将管长清零
  193. QingXiCheAndQvComRes.find().resJson["QingXiChe_06"] = new URL("../../assets/res/mp4/06.mp4", import.meta.url).href;
  194. // 拆卸高压喷头放入喷头机箱内
  195. QingXiCheAndQvComRes.find().resJson["QingXiChe_07"] = new URL("../../assets/res/mp4/07.mp4", import.meta.url).href;
  196. // 关闭车辆双闪和工作双闪箭头灯
  197. QingXiCheAndQvComRes.find().resJson["QingXiChe_08"] = new URL("../../assets/res/mp4/08.mp4", import.meta.url).href;
  198. // 关闭取力器开关
  199. QingXiCheAndQvComRes.find().resJson["QingXiChe_09"] = new URL("../../assets/res/mp4/09.mp4", import.meta.url).href;
  200. // 将车辆正常熄火,恭喜你完成全部操作
  201. QingXiCheAndQvComRes.find().resJson["QingXiChe_10"] = new URL("../../assets/res/mp4/10.mp4", import.meta.url).href;
  202. // 调整卷筒器到合适位置
  203. QingXiCheAndQvComRes.find().resJson["QingXiChe_11"] = new URL("../../assets/res/mp4/11.mp4", import.meta.url).href;
  204. // 至触摸屏关闭冲水开关
  205. QingXiCheAndQvComRes.find().resJson["QingXiChe_12"] = new URL("../../assets/res/mp4/12.mp4", import.meta.url).href;
  206. // 打开车门进入驾驶室
  207. QingXiCheAndQvComRes.find().resJson["QingXiChe_13"] = new URL("../../assets/res/mp4/13.mp4", import.meta.url).href;
  208. // 疏通管道后减小油门到初始状态
  209. QingXiCheAndQvComRes.find().resJson["QingXiChe_14"] = new URL("../../assets/res/mp4/14.mp4", import.meta.url).href;
  210. // 踩下车辆离合器5秒
  211. QingXiCheAndQvComRes.find().resJson["QingXiChe_15"] = new URL("../../assets/res/mp4/15.mp4", import.meta.url).href;
  212. // 在施工范围放置警示标识
  213. QingXiCheAndQvComRes.find().resJson["QingXiChe_16"] = new URL("../../assets/res/mp4/16.mp4", import.meta.url).href;
  214. // 套上高压水管护管器
  215. QingXiCheAndQvComRes.find().resJson["QingXiChe_17"] = new URL("../../assets/res/mp4/17.mp4", import.meta.url).href;
  216. // 将高压水管放入待施工的管道内
  217. QingXiCheAndQvComRes.find().resJson["QingXiChe_18"] = new URL("../../assets/res/mp4/18.mp4", import.meta.url).href;
  218. // 回到驾驶室踩下车辆离合器5秒
  219. QingXiCheAndQvComRes.find().resJson["QingXiChe_19"] = new URL("../../assets/res/mp4/19.mp4", import.meta.url).href;
  220. // 安装合适的高压喷头
  221. QingXiCheAndQvComRes.find().resJson["QingXiChe_20"] = new URL("../../assets/res/mp4/20.mp4", import.meta.url).href;
  222. // 在安全的情况开启冲水开关
  223. QingXiCheAndQvComRes.find().resJson["QingXiChe_21"] = new URL("../../assets/res/mp4/21.mp4", import.meta.url).href;
  224. // 缓慢抬起离合器
  225. QingXiCheAndQvComRes.find().resJson["QingXiChe_22"] = new URL("../../assets/res/mp4/22.mp4", import.meta.url).href;
  226. // 下车确定安全灯显示是否正常
  227. QingXiCheAndQvComRes.find().resJson["QingXiChe_23"] = new URL("../../assets/res/mp4/23.mp4", import.meta.url).href;
  228. // 根据现场工况调节冲水压力
  229. QingXiCheAndQvComRes.find().resJson["QingXiChe_24"] = new URL("../../assets/res/mp4/24.mp4", import.meta.url).href;
  230. // 带压收回高压水管
  231. QingXiCheAndQvComRes.find().resJson["QingXiChe_25"] = new URL("../../assets/res/mp4/25.mp4", import.meta.url).href;
  232. // 将高压水管拧到水管固定座
  233. QingXiCheAndQvComRes.find().resJson["QingXiChe_26"] = new URL("../../assets/res/mp4/26.mp4", import.meta.url).href;
  234. // QingXiCheAndQvComRes.find().resJson["QingXiChe_01"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  235. // QingXiCheAndQvComRes.find().resJson["QingXiChe_02"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  236. // QingXiCheAndQvComRes.find().resJson["QingXiChe_03"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  237. // QingXiCheAndQvComRes.find().resJson["QingXiChe_04"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  238. // QingXiCheAndQvComRes.find().resJson["QingXiChe_05"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  239. // QingXiCheAndQvComRes.find().resJson["QingXiChe_06"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  240. // QingXiCheAndQvComRes.find().resJson["QingXiChe_07"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  241. // QingXiCheAndQvComRes.find().resJson["QingXiChe_08"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  242. // QingXiCheAndQvComRes.find().resJson["QingXiChe_09"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  243. // QingXiCheAndQvComRes.find().resJson["QingXiChe_10"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  244. // QingXiCheAndQvComRes.find().resJson["QingXiChe_11"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  245. // QingXiCheAndQvComRes.find().resJson["QingXiChe_12"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  246. // QingXiCheAndQvComRes.find().resJson["QingXiChe_13"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  247. // QingXiCheAndQvComRes.find().resJson["QingXiChe_14"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  248. // QingXiCheAndQvComRes.find().resJson["QingXiChe_15"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  249. // QingXiCheAndQvComRes.find().resJson["QingXiChe_16"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  250. // QingXiCheAndQvComRes.find().resJson["QingXiChe_17"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  251. // QingXiCheAndQvComRes.find().resJson["QingXiChe_18"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  252. // QingXiCheAndQvComRes.find().resJson["QingXiChe_19"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  253. // QingXiCheAndQvComRes.find().resJson["QingXiChe_20"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  254. // QingXiCheAndQvComRes.find().resJson["QingXiChe_21"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  255. // QingXiCheAndQvComRes.find().resJson["QingXiChe_22"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  256. // QingXiCheAndQvComRes.find().resJson["QingXiChe_23"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  257. // QingXiCheAndQvComRes.find().resJson["QingXiChe_24"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  258. // QingXiCheAndQvComRes.find().resJson["QingXiChe_25"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  259. // QingXiCheAndQvComRes.find().resJson["QingXiChe_26"] = new URL("../../assets/res/mp4/demo/01.mp4", import.meta.url).href;
  260. }
  261. /**
  262. * 回调距离范围内
  263. */
  264. const callbackDistanceYesEvent = (json) => {
  265. // console.log("回调距离范围内", json);
  266. }
  267. /**
  268. * 回调距离范围外
  269. */
  270. const callbackDistanceNoEvent = (json) => {
  271. // console.log("回调距离范围外", json);
  272. }
  273. /**
  274. * 回调视角切换完成
  275. */
  276. const callbackCameraVisualAngleJsonToLookEvent = (json) => {
  277. console.log("视角触发完成", json);
  278. let objIframe = CommonVal().obj.CommonValQingXiCheAndQv.objIframe;
  279. let objScene = objIframe.ChengGuangYuanJing.CommonVal.find().objScene;
  280. let BABYLON = objIframe.BABYLON;
  281. let ChengGuangYuanJing = objIframe.ChengGuangYuanJing;
  282. // 相机前后左右移动速度
  283. ChengGuangYuanJing.CameraArray.find().jsonCamera.speedMove = 0.03;
  284. // 相机QE上下移动速度
  285. ChengGuangYuanJing.CameraArray.find().jsonCamera.upDownSpeed = 0.03;
  286. // 更新相机参数
  287. ChengGuangYuanJing.CameraArray.find().activeCameraConfigUpdate();
  288. let objIframeEdit = CommonVal().obj.CommonValQingXiCheAndQv;
  289. if (json.name == '绕车1') {
  290. objIframeEdit.cameraVisualAngleGetListNameGpsTo("绕车2");
  291. }
  292. if (json.name == '绕车2') {
  293. objIframeEdit.cameraVisualAngleGetListNameGpsTo("绕车3");
  294. }
  295. if (json.name == '绕车3') {
  296. objIframeEdit.cameraVisualAngleGetListNameGpsTo("绕车4");
  297. }
  298. if (json.name == '绕车4') {
  299. objIframeEdit.cameraVisualAngleGetListNameGpsTo("绕车5");
  300. }
  301. if (json.name == '绕车5') {
  302. objIframeEdit.cameraVisualAngleGetListNameGpsTo("绕车6");
  303. }
  304. if (json.name == '绕车6') {
  305. objIframeEdit.cameraVisualAngleGetListNameGpsTo("清洗车-开门");
  306. }
  307. if (json.name == '调整坐姿') {
  308. objIframeEdit.cameraVisualAngleGetListNameGpsTo("手握方向盘");
  309. }
  310. if (json.name == '手握方向盘') {
  311. // objIframeEdit.cameraVisualAngleGetListNameGpsTo("踩下离合器踏板");
  312. objIframeEdit.cameraVisualAngleGetListNameGpsTo("清洗车踩离合5秒");
  313. }
  314. if (json.name == '回到驾驶室踩下车辆离合器5秒1') {
  315. QingXiCheAdnQvCarEventStep.find().animationAllTypeUpdate('清洗车_打开左门', function() {
  316. objIframeEdit.cameraVisualAngleGetListNameGpsTo("回到驾驶室踩下车辆离合器5秒2");
  317. });
  318. }
  319. if (json.name == '清洗车流程完成') {
  320. QingXiCheAndQvCarEventClick.find().closeCarMen(function() {});
  321. }
  322. if (json.name == '清洗车打开车门') {
  323. objIframeEdit.cameraVisualAngleGetListNameGpsTo("清洗车进入副驾驶1");
  324. }
  325. if (json.name == '清洗车进入副驾驶1') {
  326. objIframeEdit.cameraVisualAngleGetListNameGpsTo("清洗车进入副驾驶2");
  327. }
  328. if (json.name == '清洗车下车_1') {
  329. objIframeEdit.cameraVisualAngleGetListNameGpsTo("清洗车下车_2");
  330. }
  331. }
  332. </script>
  333. <template>
  334. <div class="ThreeWorldEventMain">
  335. <ThreeWorldQingXiCheAndQv
  336. :iframeId="'CommonValQingXiCheAndQv'"
  337. :url="threeWorldUrl"
  338. @callbackLoadPercentage="callbackLoadPercentageEvent"
  339. @callbackLoadEnd="callbackLoadEndEvent"
  340. @callbackDistanceYes="callbackDistanceYesEvent"
  341. @callbackDistanceNo="callbackDistanceNoEvent"
  342. @callbackCameraVisualAngleJsonToLook="callbackCameraVisualAngleJsonToLookEvent"
  343. ></ThreeWorldQingXiCheAndQv>
  344. <img class="mengBan" src="../../assets/res/img/com/meng_ban.webp" />
  345. </div>
  346. </template>
  347. <style lang="less" scoped>
  348. .ThreeWorldEventMain * {
  349. -moz-user-select: none;
  350. -webkit-user-select: none;
  351. -ms-user-select: none;
  352. -khtml-user-select: none;
  353. user-select: none;
  354. }
  355. .ThreeWorldEventMain {
  356. position: fixed;
  357. top: 0px;
  358. left: 0px;
  359. width: 100%;
  360. height: 100%;
  361. z-index: 0;
  362. .mengBan {
  363. position: fixed;
  364. top: 0px;
  365. left: 0px;
  366. width: 100%;
  367. height: 100%;
  368. z-index: 1000;
  369. /* 注意这里必须是被允许穿透点击的,否则堆叠高于了 canvas,则会出现无法点击到canvas了。加了这个即可解决这个问题 */
  370. pointer-events: none;
  371. opacity: 0.3;
  372. }
  373. }
  374. </style>