zhouenguang 3 years ago
parent
commit
841508b39e
2 changed files with 4 additions and 1 deletions
  1. 3 1
      src/Socket.js
  2. 1 0
      src/XMaterialComponent.js

+ 3 - 1
src/Socket.js

@@ -111,7 +111,7 @@ export default class Socket extends EventEmitter {
                   rtt: 0,
                   rtt: 0,
                 });
                 });
             return;
             return;
-          }
+          } 
           this.send({
           this.send({
             id: "heartbeat",
             id: "heartbeat",
             data: t,
             data: t,
@@ -207,6 +207,8 @@ export default class Socket extends EventEmitter {
         if (!r) return;
         if (!r) return;
         const n = r.id;
         const n = r.id;
 
 
+        if(n == "heartbeat") console.log("Socket心跳请求时间(ms):", Date.now() - parseInt(r.data))
+
         if (!!n)
         if (!!n)
           switch (
           switch (
             (n !== "heartbeat" && logger.info(`receive ws frame: ${t.data}`), n)
             (n !== "heartbeat" && logger.info(`receive ws frame: ${t.data}`), n)

+ 1 - 0
src/XMaterialComponent.js

@@ -99,6 +99,7 @@ export default class XMaterialComponent {
     const width = e.width || 720;
     const width = e.width || 720;
     const height = e.height || 1280;
     const height = e.height || 1280;
     const focus = width / (2 * Math.tan((Math.PI * fov) / 360));
     const focus = width / (2 * Math.tan((Math.PI * fov) / 360));
+    console.error(width, height);
     (lowModelShader = this._lowModelShader) == null ||
     (lowModelShader = this._lowModelShader) == null ||
       lowModelShader.setVector3(
       lowModelShader.setVector3(
         "focal_width_height",
         "focal_width_height",