| | |
| | | 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++) { |
| | |
| | | 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(); |
| | | } |
| | | }, |
| | | |
| | | }; |