人生啊人生 1 săptămână în urmă
părinte
comite
0207146962

+ 79 - 54
src/components/ThreeWorldEventQingXiCheAndQv/js/QingXiCheAndQvCarEvent.js

@@ -60,6 +60,12 @@ export class QingXiCheAndQvCarEvent {
         this.particleSystemAutoSphere = {
 
         };
+
+
+        /**
+         * 展示3d GUI的次数累加
+         */
+        this.threeWorldTxtNum = 0;
         
         /**
          * 记录成功绕车的点位
@@ -605,6 +611,54 @@ export class QingXiCheAndQvCarEvent {
     }
     
 
+    /**
+     * 通知展示3d GUI 的文本
+     * positionX                坐标X
+     * positionY                坐标Y
+     * positionZ                坐标Z
+     * scaling                  UI整体缩放
+     * width                    控制宽度 px  如果 width <= -1 或者 height <= -1 则变成,显示指定固定UI
+     * height                   控制高度 px
+     * txtTop                   顶部文本
+     * txtBottom                底部文本
+     */
+    threeWorldTxt = (positionX, positionY, positionZ, scaling, width, height, txtTop, txtBottom) => {
+
+        let thisClass = this;
+        let objThreeWorldEventMain = this.objThreeWorldEventMain;
+
+        let objIframeEdit = objThreeWorldEventMain.objIframeEdit;
+        let objIframe = objThreeWorldEventMain.objIframe;
+        let objScene = objThreeWorldEventMain.objScene;
+        let BABYLON = objThreeWorldEventMain.BABYLON;
+        let ChengGuangYuanJing = objIframe.ChengGuangYuanJing;
+
+        thisClass.threeWorldTxtNum += 1;
+
+        let code = "addOrUpdate_" + thisClass.threeWorldTxtNum;
+        
+        CommonGuiDbListTwo.find().addOrUpdate(code,
+            new BABYLON.Vector3( positionX, positionY, positionZ ), scaling, width, height, { "code" : code },
+            function(res) { console.log("自定义回调数据点击回调", res); },
+            [
+                {
+                    "type" : "title", "value" : "温馨提示", "height" : 30,
+                    "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff",
+                },
+                {
+                    "tagName" : txtTop, "text" : txtBottom, "type" : "switch", "value" : 1,
+                    "unit" : null, "height" : 30, "rectangleColor" : "#000000",
+                    "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#00d800",
+                    "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff",
+                },
+            ],
+            false
+        );
+
+        return thisClass;
+        
+    }
+
 
     /**
      * 仿真模拟开始先进行初始化
@@ -701,14 +755,9 @@ export class QingXiCheAndQvCarEvent {
 
         objIframeEdit.cameraVisualAngleGetListNameGpsTo("穿衣服_1");
         
-        CommonGuiDbListTwo.find().addOrUpdate("addOrUpdate_1",
-            new BABYLON.Vector3( -32.01094814892543, 1.1861893252100466, 65.48145750781143 ), 3, 173, 68 * 2, { "code" : "addOrUpdate_1" },
-            function(res) { console.log("自定义回调数据点击回调", res); },
-            [
-                { "type" : "title", "value" : "温馨提示", "height" : 30, "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff", },
-                { "tagName" : "点击人物或者闪烁点", "text" : "或者服饰触发", "type" : "switch", "value" : 1, "unit" : null, "height" : 30, "rectangleColor" : "#000000", "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#ffffff", "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff", },
-            ],
-            false
+        QingXiCheAndQvCarEvent.find().threeWorldTxt(
+            -32.01094814892543, 1.1861893252100466, 65.48145750781143, 3, 173, 68 * 2,
+            "点击人物或者闪烁点", "或者服饰触发"
         );
         
         // WindowEvent.find().WindowTxtViewOpenEvent(
@@ -751,15 +800,10 @@ export class QingXiCheAndQvCarEvent {
 
         QingXiCheAdnQvCarEventStep.find().meshVisibility("all", false);
         QingXiCheAdnQvCarEventStep.find().meshVisibility("行至车辆区域", true);
-
-        CommonGuiDbListTwo.find().addOrUpdate("addOrUpdate_1",
-            new BABYLON.Vector3( 5.936225679133575, 0, -12.604728552806394 ), 3, 173, 68 * 2, { "code" : "addOrUpdate_1" },
-            function(res) { console.log("自定义回调数据点击回调", res); },
-            [
-                { "type" : "title", "value" : "温馨提示", "height" : 30, "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff", },
-                { "tagName" : "按照箭头方向", "text" : "行走至车辆区域", "type" : "switch", "value" : 1, "unit" : null, "height" : 30, "rectangleColor" : "#000000", "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#00d800", "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff", },
-            ],
-            false
+        
+        QingXiCheAndQvCarEvent.find().threeWorldTxt(
+            5.936225679133575, 0, -12.604728552806394, 3, 173, 68 * 2,
+            "按照箭头方向", "行走至车辆区域"
         );
         
         // 切换到人物的视角
@@ -801,15 +845,10 @@ export class QingXiCheAndQvCarEvent {
         WindowEvent.find().WindowTxtViewOpenEvent(
             "上车前,先绕车一周,观察车辆前后有无障碍物,留意周边行人、车辆动态。"
         );
-
-        CommonGuiDbListTwo.find().addOrUpdate("addOrUpdate_1",
-            new BABYLON.Vector3( 6.479333078187721, 0, -17.762281446529666 ), 3, 173, 68 * 2, { "code" : "addOrUpdate_1" },
-            function(res) { console.log("自定义回调数据点击回调", res); },
-            [
-                { "type" : "title", "value" : "温馨提示", "height" : 30, "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff", },
-                { "tagName" : "根据箭头提示", "text" : "绕车一周", "type" : "switch", "value" : 1, "unit" : null, "height" : 30, "rectangleColor" : "#000000", "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#1cc7f6", "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff", },
-            ],
-            false
+        
+        QingXiCheAndQvCarEvent.find().threeWorldTxt(
+            6.479333078187721, 0, -17.762281446529666, 3, 173, 68 * 2,
+            "根据箭头提示", "绕车一周"
         );
 
         // 切换到人物的视角
@@ -852,15 +891,11 @@ export class QingXiCheAndQvCarEvent {
         QingXiCheAdnQvCarEventStep.find().meshVisibility("打开车门进入驾驶室", true);
 
         // objIframeEdit.cameraVisualAngleGetListNameGpsTo("绕车1");
+        
 
-        CommonGuiDbListTwo.find().addOrUpdate("addOrUpdate_1",
-            new BABYLON.Vector3( 6.898374424678477, 1.7193635674763605, -15.120125554798255 ), 3, 173, 68 * 2, { "code" : "addOrUpdate_1" },
-            function(res) { console.log("自定义回调数据点击回调", res); },
-            [
-                { "type" : "title", "value" : "温馨提示", "height" : 30, "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff", },
-                { "tagName" : "请点击车门", "text" : "进入驾驶室", "type" : "switch", "value" : 1, "unit" : null, "height" : 30, "rectangleColor" : "#000000", "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#00d800", "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff", },
-            ],
-            false
+        QingXiCheAndQvCarEvent.find().threeWorldTxt(
+            6.898374424678477, 1.7193635674763605, -15.120125554798255, 3, 173, 68 * 2,
+            "请点击车门", "进入驾驶室"
         );
         
         WindowEvent.find().WindowTxtViewOpenEvent(
@@ -904,15 +939,10 @@ export class QingXiCheAndQvCarEvent {
         QingXiCheAdnQvCarEventStep.find().meshVisibility("确认手刹已拉起档位是P档然后发动车辆", true);
 
         // objIframeEdit.cameraVisualAngleGetListNameGpsTo("手刹和空挡");
-
-        CommonGuiDbListTwo.find().addOrUpdate("addOrUpdate_1",
-            new BABYLON.Vector3( 7.780494970287971, 1.8481770926391616, -14.356549739824747 ), 3, 173, 68 * 2, { "code" : "addOrUpdate_1" },
-            function(res) { console.log("自定义回调数据点击回调", res); },
-            [
-                { "type" : "title", "value" : "温馨提示", "height" : 30, "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff", },
-                { "tagName" : "点击E/P开关", "text" : "切换至P档", "type" : "switch", "value" : 1, "unit" : null, "height" : 30, "rectangleColor" : "#000000", "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#00d800", "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff", },
-            ],
-            false
+        
+        QingXiCheAndQvCarEvent.find().threeWorldTxt(
+            -32.01094814892543, 1.1861893252100466, 65.48145750781143, 3, 173, 68 * 2,
+            "点击E/P开关", "切换至P档"
         );
 
         WindowEvent.find().WindowTxtViewOpenEvent(
@@ -953,6 +983,8 @@ export class QingXiCheAndQvCarEvent {
 
         // objIframeEdit.cameraVisualAngleGetListNameGpsTo("手刹和空挡");
 
+        
+
         WindowEvent.find().WindowTxtViewOpenEvent(
             "拧动启动钥匙,发动车辆。"
         );
@@ -1269,19 +1301,12 @@ export class QingXiCheAndQvCarEvent {
         QingXiCheAdnQvCarEventStep.find().meshVisibility("在施工范围放置警示标识", true);
 
         // objIframeEdit.cameraVisualAngleGetListNameGpsTo("在施工范围放置警示标识1");
-
-
-        CommonGuiDbListTwo.find().addOrUpdate("addOrUpdate_1",
-            new BABYLON.Vector3( 14.022634838184539, 0.9201802968480344, -12.014094493412726 ), 3, 173, 68 * 2, { "code" : "addOrUpdate_1" },
-            function(res) { console.log("自定义回调数据点击回调", res); },
-            [
-                { "type" : "title", "value" : "温馨提示", "height" : 30, "rectangleColor" : "#a9d5ff", "fontColor" : "#FFFFFF", "fontSize" : 10, "background" : "#a9d5ff", },
-                { "tagName" : "点击安全桩", "text" : "或者闪烁点触发", "type" : "switch", "value" : 1, "unit" : null, "height" : 30, "rectangleColor" : "#000000", "left_fontColor" : "#ffffff", "left_fontSize" : 12, "left_background" : "#00d800", "right_fontColor" : "#ffffff", "right_fontSize" : 12, "right_background" : "#ffffff", },
-            ],
-            false
+        
+        QingXiCheAndQvCarEvent.find().threeWorldTxt(
+            14.022634838184539, 0.9201802968480344, -12.014094493412726, 3, 173, 68 * 2,
+            "点击安全桩", "或者闪烁点触发"
         );
 
-
         WindowEvent.find().WindowTxtViewOpenEvent(
             "携带反光锥、警示牌等安全设备,沿施工场地边缘,间隔适当距离摆放。确保警示标识醒目稳固,全方位提醒过往人员注意安全。" + "\n"
         );