From ada814580615bd5b7d25013525f8054edfce2800 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期六, 11 十二月 2021 15:00:05 +0800
Subject: [PATCH] #

---
 static/js/app.js               |    5 +++++
 static/js/utils.js             |    0 
 static/js/object/StoreShelf.js |    8 ++++----
 static/js/object/StoreCrn.js   |   38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/static/js/app.js b/static/js/app.js
index 4252de3..e31f7d6 100644
--- a/static/js/app.js
+++ b/static/js/app.js
@@ -29,6 +29,7 @@
 			this.initLight();
 			this.initFloor();
 			this.initModel();
+			this.initModel0();
 			this.initStoreObjects(this);
 		}
 		this.animate = function () {
@@ -185,6 +186,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);
@@ -258,6 +260,9 @@
 				}
 			}
 		}
+		this.initModel0 = function () {
+
+		}
 		this.getExistedGoodType=function(state){
 			for (let i=0;i<this.goodTypes.length;i++) {
 				let type=this.goodTypes[i];
diff --git a/static/js/object/StoreCrn.js b/static/js/object/StoreCrn.js
new file mode 100644
index 0000000..a55f268
--- /dev/null
+++ b/static/js/object/StoreCrn.js
@@ -0,0 +1,38 @@
+function StoreCrn(option, object) {
+    console.log(option);
+    this.crnLength = option.crnBody.length||50;//搴撲綅闀垮害
+    this.crnWidth = option.crnBody.width||50;//搴撲綅瀹�
+    this.crnHeight = option.crnBody.height||500;//搴撲綅楂�
+
+    // 绔嬫煴
+    var a = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnLength, this.crnHeight, this.crnWidth), new THREE.MeshBasicMaterial({
+        color: 0x00ffff,
+        transparent: true,
+        opacity: .8
+    }))
+    a.position.x = option.crnBody.position.x;
+    a.position.y = option.crnBody.position.y + this.crnHeight/2;
+    a.position.z = option.crnBody.position.z - this.crnWidth/2;
+    object.addObject(a);
+    // 杞借揣鍙�
+    var b = new THREE.Mesh(new THREE.BoxBufferGeometry(10,10,10), new THREE.MeshBasicMaterial({
+        color: 0x0000ff,
+        transparent: true,
+        opacity: 1
+    }))
+    b.position.x = option.crnLoad.position.x;
+    b.position.y = 0;
+    b.position.z = 0;
+    object.addObject(b);
+    // 鍙夌墮
+    var c = new THREE.Mesh(new THREE.BoxBufferGeometry(5,5,5), new THREE.MeshBasicMaterial({
+        color: 0xff00ff,
+        transparent: true,
+        opacity: 1
+    }))
+    c.position.x = option.crnFork.position.x;
+    c.position.y = 0;
+    c.position.z = 0;
+    object.addObject(c);
+
+}
diff --git a/static/js/object/StoreShelf.js b/static/js/object/StoreShelf.js
index fd6b3f6..98bea40 100644
--- a/static/js/object/StoreShelf.js
+++ b/static/js/object/StoreShelf.js
@@ -18,7 +18,7 @@
     let group = new THREE.Group();
 
     // 璐ф灦鎬婚珮
-    let shelfHeight=this.bottomHight+(this.binYNum-1)*this.binHeight;
+    let shelfHeight=this.bottomHight+(this.binYNum)*this.binHeight;
     // 璐ф灦鎬诲
     let shelfWidth=this.binZNum*this.binWidth;
     // 鏀灦妯″瀷 + 鏉愯川
@@ -39,7 +39,7 @@
     // 鍒濆鍖栨敮鏋舵ā鍨�
     for(let i=0;i<=this.binZNum;i++) {
         let leftRack = rackObject.clone();
-        let positionZ = this.positionZ - shelfWidth/2 + i*this.binWidth;
+        let positionZ = - ( this.positionZ + i*this.binWidth );
         leftRack.position.set(leftPositionX,positionY,positionZ);
         leftRack.updateMatrix();
         group.add(leftRack);
@@ -51,10 +51,10 @@
     }
     // 鍒濆鍖栨墭鏉挎ā鍨�
     for(let i = 0;i < this.binZNum;i++) {
-        for (let j = 0;j < this.binYNum;j++) {
+        for (let j = 0;j <= this.binYNum;j++) {
             let plane = planeObject.clone();
             let positionY= this.positionY + this.bottomHight + j*this.binHeight + 1;
-            let positionZ= this.positionZ - shelfWidth/2 + i * this.binWidth + this.binWidth/2;
+            let positionZ= - ( this.positionZ + i * this.binWidth + this.binWidth/2 );
             plane.position.set(this.positionX-this.rackLengh/2,positionY,positionZ);
             plane.updateMatrix();
             group.add(plane);
diff --git a/static/js/utils.js b/static/js/utils.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/static/js/utils.js

--
Gitblit v1.9.1