浏览代码

fix: Merge branch 'master' of http://192.168.0.115:3000/xushiting/Metaverse

# Conflicts:
#	src/XSceneManager.js
zhouenguang 3 年之前
父节点
当前提交
b1619b8b7b
共有 5 个文件被更改,包括 2169 次插入39 次删除
  1. 2082 0
      dist/assets/config0.json
  2. 5 5
      src/Reporter.js
  3. 1 0
      src/XBreathPointManager.js
  4. 34 34
      src/XSceneManager.js
  5. 47 0
      src/main.js

文件差异内容过多而无法显示
+ 2082 - 0
dist/assets/config0.json


+ 5 - 5
src/Reporter.js

@@ -12,11 +12,11 @@ export default class Reporter extends EventEmitter {
         this._header.logModuleId = REPORT_MODULE_TYPE,
         this._header.url = location.href,
         this._header.enviroment = ENV,
-        this._header.networkType = window.navigator.connection ? window.navigator.connection.type : "unknown",
-        this._interval = window.setInterval(()=>{
-            this._flushReport()
-        }
-        , 10 * 1e3)
+        this._header.networkType = window.navigator.connection ? window.navigator.connection.type : "unknown";
+        // this._interval = window.setInterval(()=>{
+        //     this._flushReport()
+        // }
+        // , 10 * 1e3)
     }
     
     disable() {

+ 1 - 0
src/XBreathPointManager.js

@@ -16,6 +16,7 @@ export default class XBreathPointManager {
         E(this, "_loopBPKeys", []);
         E(this, "addBreathPoint", async e=>{
             const t = [{
+                //url: "https://metaverse.oss-cn-beijing.aliyuncs.com/images/texture.png"
                 url: "https://static.xverse.cn/qqktv/texture.png"
             }];
             if (t.length <= 0) {

+ 34 - 34
src/XSceneManager.js

@@ -169,7 +169,7 @@ export default class XSceneManager {
         this._billboardManager = new XBillboardManager(this),
         this.billboardComponent.loadBackGroundTexToIDB(),
         this._lightManager = new XLightManager(this),
-        this.readPointData(),
+        // this.readPointData(),
         this.postprocessing(),
         this.initSceneManager(),
         this.engineRunTimeStats = new XEngineRunTimeStats,
@@ -459,44 +459,44 @@ export default class XSceneManager {
         r
     }
 
-    // zeg
-    readPointData() {
+    // // zeg
+    // readPointData() {
         
-        return fetch("./assets/points.json", {
-            headers: {
-                'content-type': 'application/json'
-            },
-            method: 'GET',
-        })
-        .then(response => response.json())
-        .then(response => {
-            this.texture = new BABYLON.Texture("https://4dkk.4dage.com/v3/img/marker.png", this.scene);
-            response.forEach(data => {
-                var plane = new BABYLON.Mesh.CreatePlane("TextPlane", 0.2, this.scene, true);
-                plane.material = new BABYLON.StandardMaterial("TextPlaneMaterial", this.scene);
-                plane.material.alpha = 1,
-                plane.material.emissiveTexture = this.texture,
-                plane.material.backFaceCulling = true,
-                plane.material.diffuseTexture = this.texture,
-                plane.material.diffuseTexture.hasAlpha = !0,
-                plane.material.useAlphaFromDiffuseTexture = !0
+    //     return fetch("./assets/points.json", {
+    //         headers: {
+    //             'content-type': 'application/json'
+    //         },
+    //         method: 'GET',
+    //     })
+    //     .then(response => response.json())
+    //     .then(response => {
+    //         this.texture = new BABYLON.Texture("https://4dkk.4dage.com/v3/img/marker.png", this.scene);
+    //         response.forEach(data => {
+    //             var plane = new BABYLON.Mesh.CreatePlane("TextPlane", 0.2, this.scene, true);
+    //             plane.material = new BABYLON.StandardMaterial("TextPlaneMaterial", this.scene);
+    //             plane.material.alpha = 1,
+    //             plane.material.emissiveTexture = this.texture,
+    //             plane.material.backFaceCulling = true,
+    //             plane.material.diffuseTexture = this.texture,
+    //             plane.material.diffuseTexture.hasAlpha = !0,
+    //             plane.material.useAlphaFromDiffuseTexture = !0
 
-                plane.rotation.x = Math.PI / 2
-                plane.position.x = -data.position.x;
-                plane.position.y = data.position.y+0.01;
-                plane.position.z = data.position.z;
+    //             plane.rotation.x = Math.PI / 2
+    //             plane.position.x = -data.position.x;
+    //             plane.position.y = data.position.y+0.01;
+    //             plane.position.z = data.position.z;
 
-                // todo 矫正
-                let ue4Pos = util.xversePosition2Ue4({x: -data.position.x, y: data.position.y, z: data.position.z}) 
-                // console.error(data.position, ue4Pos)
-                data.position0 = data.position
-                data.position = new BABYLON.Vector3(ue4Pos.x, ue4Pos.y, ue4Pos.z)
+    //             // todo 矫正
+    //             let ue4Pos = util.xversePosition2Ue4({x: -data.position.x, y: data.position.y, z: data.position.z}) 
+    //             // console.error(data.position, ue4Pos)
+    //             data.position0 = data.position
+    //             data.position = new BABYLON.Vector3(ue4Pos.x, ue4Pos.y, ue4Pos.z)
 
-            })
-            window.points = response
-        })
+    //         })
+    //         window.points = response
+    //     })
 
-    }
+    // }
 
     getClosestPointData(vec) {
         vec = new BABYLON.Vector3(vec.x, vec.y, vec.z)

+ 47 - 0
src/main.js

@@ -51,6 +51,8 @@ const l = async () => {
     });
     window.room = room;
 
+    readPointData()
+
     u();
     c();
 
@@ -97,7 +99,52 @@ const c = () => {
       );
     });
 };
+
 l();
 
+const BREATH_POINT_TYPE = "debugBreathPoint"
+  , TAP_BREATH_POINT_TYPE = "debugTapBreathPoint"
+  , DEFAULT_SEARCH_RANGE = 1e3;
+
+  function xversePosition2Ue4(i){
+    return {
+      x: i.x * 100,
+      y: -1 * i.z * 100,
+      z: i.y * 100
+    }
+  }
+
+  function readPointData() {
+    return fetch("./assets/points.json", {
+        headers: {
+            'content-type': 'application/json'
+        },
+        method: 'GET',
+    })
+    .then(response => response.json())
+    .then(response => {
+        response.forEach(data => {
+
+            let ue4Pos = xversePosition2Ue4({x: -data.position.x, y: data.position.y, z: data.position.z})
+            data.position0 = data.position
+            data.position = new BABYLON.Vector3(ue4Pos.x, ue4Pos.y, ue4Pos.z)
+
+            const a = JSON.stringify(data.position);
+            window.room.breathPointManager.breathPoints.get(a) || window.room.breathPointManager.addBreathPoint({
+                id: a,
+                position: data.position,
+                type: BREATH_POINT_TYPE,
+                rotation: {
+                    pitch: 90,
+                    yaw: 0,
+                    roll: 0
+                },
+                forceLeaveGround: !0
+            })
+            
+        })
+        window.points = response
+    })
+}
 // console.log("tinyh264", tinyh264);
 // debugger;