| | |
| | | this.initReSize(this); |
| | | this.initPointLockControl(this); |
| | | this.initFloor(); |
| | | this.initBuilding(); |
| | | this.initTransporter(this); |
| | | } |
| | | this.animate = function () { |
| | | requestAnimationFrame(this.animate.bind(this)); |
| | |
| | | |
| | | // this.addObject(new Floor({position: {}})) |
| | | } |
| | | this.initBuilding = function () { |
| | | let buildingData = buildingObjects.objects; |
| | | for (let i = 0; i < buildingData.length; i++) { |
| | | let objectOption = buildingData[i]; |
| | | switch (objectOption.objectType) { |
| | | case "cube": |
| | | let cube = new Cube(objectOption); |
| | | this.addObject(cube); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | this.initTransporter = function (object) { |
| | | } |
| | | this.initStoreObjects = function (object) { |
| | | if (this.firstTime === 1) { |
| | | if (Store3DData !== undefined && Store3DData !== null) { |
| | |
| | | |
| | | |
| | | function CommonFunction() { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 判断当前对象是否为空对象 |
| | | */ |
| | | CommonFunction.hasObj = function (obj) { |
| | | if (obj != null && typeof (obj) != "undefined") { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | return obj != null && typeof (obj) != "undefined"; |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * 创建材质 |
| | | * length:材质的长 |
| | |
| | | let material = new THREE.MeshPhongMaterial({map: texture, color: color}); |
| | | if (image != null) { |
| | | texture = new THREE.TextureLoader().load(image); |
| | | if (allowRepeat == 1) { |
| | | if (allowRepeat === 1) { |
| | | texture.repeat.x = length / 128; |
| | | texture.repeat.y = width / 128; |
| | | texture.repeat.y = 5; |
| | |
| | | } |
| | | material = new THREE.MeshPhongMaterial({map: texture}); |
| | | } |
| | | if (transparent == 1) { |
| | | if (transparent === 1) { |
| | | material.transparent = true; |
| | | } |
| | | if (depthTest == 0) { |
| | | if (depthTest === 0) { |
| | | material.depthTest = false; |
| | | } |
| | | material.opacity = opacity; |
| | | return material; |
| | | } |
| | | |
| | | /** |
| | | * 转换坐标 |
| | | * positionOri:原始坐标 |
| | | * positionTrans:转换坐标 |
| | | */ |
| | | |
| | | CommonFunction.transPosition=function(positionOri,positionTrans) |
| | | { |
| | | CommonFunction.transPosition=function(positionOri,positionTrans) { |
| | | |
| | | positionOri.X = positionOri.X + positionTrans.X; |
| | | positionOri.Y = positionOri.Y + positionTrans.Y; |
New file |
| | |
| | | let buildingObjects = { |
| | | objects: [ |
| | | { |
| | | objectName: 'floor', |
| | | objectType: 'cube', |
| | | length: 1400, |
| | | width: 1200, |
| | | height: 1, |
| | | position: { |
| | | x: 700, |
| | | y: 600, |
| | | z: 0 |
| | | }, |
| | | style:{ |
| | | color: 0x5F7480, |
| | | } |
| | | } |
| | | ] |
| | | } |
| | |
| | | that.crnLoad = getArrVal(object.objects, "name", that.crnNo + "-load"); |
| | | that.crnFork = getArrVal(object.objects, "name", that.crnNo + "-fork"); |
| | | if (that.crnBody===null || that.crnLoad===null || that.crnFork==null) { |
| | | console.log(that.crnNo + "号堆垛机没有初始化"); |
| | | // console.log(that.crnNo + "号堆垛机没有初始化"); |
| | | } |
| | | }; |
| | | init(); |
| | |
| | | } |
| | | |
| | | curves.map((value, index) => { |
| | | console.log(value.part + " --> " + JSON.stringify(value.route.points)) |
| | | // console.log(value.part + " --> " + JSON.stringify(value.route.points)) |
| | | }); |
| | | |
| | | curves[0].start = true; |
| | |
| | | <script type="text/javascript" src="../static/js/utils.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/js/data/Asrs.js"></script> |
| | | <script type="text/javascript" src="../static/js/data/BuildingData.js"></script> |
| | | <script type="text/javascript" src="../static/js/object/Cube.js"></script> |
| | | <script type="text/javascript" src="../static/js/object/StoreArea.js"></script> |
| | | <script type="text/javascript" src="../static/js/object/Store.js"></script> |