#
luxiaotao1123
2021-12-13 4b3467e05cb0e2b68bc3e8ef08827e9e874562c8
static/js/app.js
@@ -14,6 +14,7 @@
      this.firstTime = 1;
      this.stats = null;
      this.goodTypes=[];//存储所有的库位类型
      this.wrkNo = 0;
      this.start = function () {
         this.initMain();
@@ -29,6 +30,7 @@
         this.initLight();
         this.initFloor();
         this.initModel();
         this.queryTask();
         this.initStoreObjects(this);
      }
      this.animate = function () {
@@ -36,7 +38,7 @@
         this.stats.begin();
         this.renderer.render(this.scene, this.camera);
         this.stats.end();
         this.modelMove();
         // this.modelMove();
      }
      this.initScene = function () {
         this.scene = new THREE.Scene();
@@ -56,7 +58,7 @@
         // this.camera.position.z = 600;
         // //相机的朝向
         // this.camera.lookAt(0, 0, 0);
         this.camera.position.set( - 550, 2070, 4550 );
         this.camera.position.set( - 350, 1070, 1550 );
         this.camera.lookAt( this.scene.position );
         //将相机放到场景中
         this.scene.add(this.camera);
@@ -185,6 +187,7 @@
            initStore();
            if (Store3DData !== null) {
               for(var group of Store3DData.data.store.groups) {
                  let crn = new StoreCrn(group.crn, object);
                  for (var line of group.lines) {
                     let shelf = new StoreShelf(line);
                     object.addObject(shelf);
@@ -254,7 +257,15 @@
               //
               //    }
               // }
               this.firstTime = 0;
               // this.firstTime = 0;
            }
         }
      }
      this.queryTask = function () {
         if (this.firstTime === 1) {
            queryTaskCurrent();
            if (this.wrkNo !== TaskData.wrkNo) {
               this.wrkNo = TaskData.wrkNo;
            }
         }
      }
@@ -343,7 +354,9 @@
            });
      }
      this.modelMove = function () {
         // console.log(1)
         let crnBody = getArrVal(this.objects, "name", "1-body");
         console.log(crnBody.position)
      }
   },