| | |
| | | this.scene.background = new THREE.Color( 0xf0f0f0 ); |
| | | } else { |
| | | const cubeTextureLoader = new THREE.CubeTextureLoader(); |
| | | cubeTextureLoader.setPath( '../static/img/skybox/' ); |
| | | cubeTextureLoader.setPath( '../static/img/skybox0/' ); |
| | | this.scene.background = cubeTextureLoader.load([ |
| | | "px.jpg", "nx.jpg", |
| | | "py.jpg", "ny.jpg", |
| | |
| | | this.controls.addEventListener( 'unlock', function () { |
| | | console.log("上帝视角"); |
| | | object.initCamera(); |
| | | addClass(document.getElementById("ship-info-btn"), "show"); |
| | | document.getElementById("ship-type-ul").style.transform = 'translateY(-40px)'; |
| | | } ); |
| | | document.addEventListener( 'keydown', onKeyDown ); |
| | | document.addEventListener( 'keyup', onKeyUp ); |
| | |
| | | } |
| | | this.prevTime = time; |
| | | } |
| | | this.lockControl = function () { |
| | | this.camera.position.y = 100; |
| | | this.camera.lookAt(0,100,0); |
| | | this.controls.getObject().position.x =0; |
| | | this.controls.getObject().position.y =100; |
| | | this.controls.getObject().position.z =580; |
| | | this.controls.lock(); |
| | | } |
| | | this.removeObject = function (nameorid) { |
| | | for (let i = 0; i < this.objects.length; i++) { |
| | | let tmpObject = this.objects[i]; |
| | |
| | | } |
| | | this.initStoreObjects = function (object) { |
| | | if (this.firstTime === 1) { |
| | | // initStore(); |
| | | if (Store3DData !== undefined && Store3DData !== null) { |
| | | for(var group of Store3DData.data.store.groups) { |
| | | new StoreCrn(group.crn, object); |
| | |
| | | } |
| | | } |
| | | this.queryCrn = function () { |
| | | if (CrnDatas !== null) { |
| | | if (CrnDatas !== null && this.firstTime === 0) { |
| | | for (let crnData of CrnDatas) { |
| | | let crnTask = getArrVal(this.crnTasks, "crnNo", crnData.crnNo); |
| | | if (null == crnTask) { |
| | |
| | | this.backgroundType = !this.backgroundType; |
| | | this.initBackground(); |
| | | } |
| | | |
| | | this.lockControl = function () { |
| | | this.camera.position.y = 100; |
| | | this.camera.lookAt(0,100,0); |
| | | this.controls.getObject().position.x =0; |
| | | this.controls.getObject().position.y =100; |
| | | this.controls.getObject().position.z =580; |
| | | this.controls.lock(); |
| | | } |
| | | }, |
| | | |
| | | }; |