diff --git a/editor/examples/arkanoid.app.json b/editor/examples/arkanoid.app.json index 97ac23037fd19dc121388439e11782843b59a9f6..7b5e109ee76d357ab636230e9233c00ab9e5d519 100644 --- a/editor/examples/arkanoid.app.json +++ b/editor/examples/arkanoid.app.json @@ -4,7 +4,6 @@ }, "project": { "shadows": true, - "editable": true, "vr": false }, "camera": { @@ -205,4 +204,4 @@ "source": "var ball = this.getObjectByName( 'Ball' );\n\nvar direction = new THREE.Vector3();\ndirection.x = Math.random() - 0.5;\ndirection.z = - 0.5;\ndirection.normalize();\n\nvar speed = new THREE.Vector3();\n\n//\n\nvar group = new THREE.Group();\nthis.add( group );\n\nvar paddle = this.getObjectByName( 'Paddle' );\npaddle.material.visible = false;\ngroup.add( paddle );\n\nvar brick = this.getObjectByName( 'Brick' );\n\nfor ( var j = 0; j < 8; j ++ ) {\n\n\tvar material = new THREE.MeshPhongMaterial( { color: Math.random() * 0xffffff } );\n\n\tfor ( var i = 0; i < 12; i ++ ) {\n\t\t\n\t\tvar object = brick.clone();\n\t\tobject.position.x = i * 22 - 120;\n\t\tobject.position.z = j * 14 - 120;\n\t\tgroup.add( object );\n\n\t\tvar cylinder = object.getObjectByName( 'Cylinder' );\n\t\tcylinder.material = material;\n\n\t}\n\t\n}\n\nbrick.visible = false;\nbrick.material.visible = false;\n\n//\n\nvar raycaster = new THREE.Raycaster();\n\nfunction update( event ) {\n\t\n\tif ( ball.position.x < - 150 || ball.position.x > 150 ) direction.x = - direction.x;\n\tif ( ball.position.z < - 200 || ball.position.z > 200 ) direction.z = - direction.z;\n\n\tball.position.x = Math.max( - 150, Math.min( 150, ball.position.x ) );\n\tball.position.z = Math.max( - 200, Math.min( 200, ball.position.z ) );\n\t\n\tball.position.add( speed.copy( direction ).multiplyScalar( event.delta / 4 ) );\n\t\n\traycaster.set( ball.position, direction );\n\t\n\tvar intersections = raycaster.intersectObjects( group.children );\n\t\n\tif ( intersections.length > 0 ) {\n\t\n\t\tvar intersection = intersections[ 0 ];\n\t\t\n\t\tif ( intersection.distance < 5 ) {\n\t\t\t\n\t\t\tif ( intersection.object !== paddle ) {\n\n\t\t\t\tgroup.remove( intersection.object );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tdirection.reflect( intersection.face.normal );\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n}" }] } -} \ No newline at end of file +} diff --git a/editor/examples/camera.app.json b/editor/examples/camera.app.json index 4dfe3008b1ecd5d0b0abdd43aee9f6fc5c311b62..f35b02bddf16951290bdd82328988c7eb85c0243 100644 --- a/editor/examples/camera.app.json +++ b/editor/examples/camera.app.json @@ -4,7 +4,6 @@ }, "project": { "shadows": true, - "editable": true, "vr": false }, "camera": { @@ -187,4 +186,4 @@ "source": "function update( event ) {\n\n\tvar time = event.time * 0.001;\n\n\tthis.position.x = Math.sin( time ) * 400;\n\tthis.position.z = Math.cos( time ) * 400;\n\tthis.lookAt( scene.position );\n\n}" }] } -} \ No newline at end of file +} diff --git a/editor/examples/particles.app.json b/editor/examples/particles.app.json index cfe4e46415364252696905e60e646f6ef07b6a65..4c184e97d66a735f8ad9d11006203df151a8e043 100644 --- a/editor/examples/particles.app.json +++ b/editor/examples/particles.app.json @@ -4,7 +4,6 @@ }, "project": { "shadows": true, - "editable": true, "vr": false }, "camera": { @@ -97,4 +96,4 @@ "source": "var original = this.getObjectByName( 'Particle' );\n\nvar particles = [];\n\nfor ( var i = 0; i < 100; i ++ ) {\n\n\tvar particle = original.clone();\n\tparticle.userData.velocity = new THREE.Vector3();\n\tthis.add( particle );\n\n\tparticles.push( particle );\n\n}\n\nfunction update( event ) {\n\t\n\tvar particle = particles.shift();\n\tparticles.push( particle );\n\t\t\n\tvar velocity = particle.userData.velocity;\n\tvelocity.x = Math.random() - 0.5;\n\tvelocity.y = Math.random() + 1;\n\tvelocity.z = Math.random() - 0.5;\n\n\tfor ( var i = 0; i < particles.length; i ++ ) {\n\n\t\tvar particle = particles[ i ];\n\n\t\tvar velocity = particle.userData.velocity;\n\n\t\tvelocity.y -= 0.098;\n\n\t\tparticle.position.add( velocity );\n\n\t\tif ( particle.position.y < 0 ) {\n\n\t\t\tparticle.position.y = 0;\n\n\t\t\tvelocity.y = - velocity.y;\n\t\t\tvelocity.multiplyScalar( 0.6 );\n\n\t\t}\n\n\t}\n\n}" }] } -} \ No newline at end of file +} diff --git a/editor/examples/pong.app.json b/editor/examples/pong.app.json index 0ca12aebd84a79270af0cf90e062f72368677ad1..023b59c38c6f33e08cb4303b4e24b0852d2b3060 100644 --- a/editor/examples/pong.app.json +++ b/editor/examples/pong.app.json @@ -4,7 +4,6 @@ }, "project": { "shadows": false, - "editable": false, "vr": false }, "camera": { diff --git a/editor/js/Config.js b/editor/js/Config.js index 21474792bea9f615a8b527f6a7cfe03e577fc3b7..6e4fa3ba59619538f941a4196bae7d7cd479d4c3 100644 --- a/editor/js/Config.js +++ b/editor/js/Config.js @@ -13,7 +13,6 @@ var Config = function ( name ) { 'project/renderer/gammaInput': false, 'project/renderer/gammaOutput': false, 'project/renderer/shadows': true, - 'project/editable': false, 'project/vr': false, 'settings/history': false diff --git a/editor/js/Editor.js b/editor/js/Editor.js index 5f518fd253cb9b2bf510b05a957105355728cae1..dbc6e6640f721cbcb5ff32ee5ff4e586ffd37b79 100644 --- a/editor/js/Editor.js +++ b/editor/js/Editor.js @@ -500,7 +500,6 @@ Editor.prototype = { gammaInput: this.config.getKey( 'project/renderer/gammaInput' ), gammaOutput: this.config.getKey( 'project/renderer/gammaOutput' ), shadows: this.config.getKey( 'project/renderer/shadows' ), - editable: this.config.getKey( 'project/editable' ), vr: this.config.getKey( 'project/vr' ) }, camera: this.camera.toJSON(), diff --git a/editor/js/Sidebar.Project.js b/editor/js/Sidebar.Project.js index bcf6edbdd841e6b09eab1440fd4c7d3fb456d915..d1c58da8250a524ec727bed7dd199d5dda53ee6e 100644 --- a/editor/js/Sidebar.Project.js +++ b/editor/js/Sidebar.Project.js @@ -101,20 +101,6 @@ Sidebar.Project = function ( editor ) { container.add( rendererPropertiesRow ); - // Editable - - var editableRow = new UI.Row(); - var editable = new UI.Checkbox( config.getKey( 'project/editable' ) ).setLeft( '100px' ).onChange( function () { - - config.setKey( 'project/editable', this.getValue() ); - - } ); - - editableRow.add( new UI.Text( 'Editable' ).setWidth( '90px' ) ); - editableRow.add( editable ); - - container.add( editableRow ); - // VR var vrRow = new UI.Row(); diff --git a/editor/js/libs/app.js b/editor/js/libs/app.js index 8d50cf03599f1c6e29324308a6e413474bfe4aa6..6acec01426c57fb6505eb9e2b1c11c2d147cf2ae 100644 --- a/editor/js/libs/app.js +++ b/editor/js/libs/app.js @@ -6,8 +6,6 @@ var APP = { Player: function () { - var scope = this; - var loader = new THREE.ObjectLoader(); var camera, scene, renderer; diff --git a/editor/js/libs/app/index.html b/editor/js/libs/app/index.html index b5e9fea85a2cca8332cfa3365fb1efeab85cce2f..21194e73e104506efceebaec98e5a1c4fa38ce37 100644 --- a/editor/js/libs/app/index.html +++ b/editor/js/libs/app/index.html @@ -6,26 +6,13 @@ @@ -37,30 +24,13 @@ var loader = new THREE.FileLoader(); loader.load( 'app.json', function ( text ) { - var json = JSON.parse( text ); - var player = new APP.Player(); - player.load( json ); + player.load( JSON.parse( text ) ); player.setSize( window.innerWidth, window.innerHeight ); player.play(); document.body.appendChild( player.dom ); - if ( json.project.editable === true ) { - - var button = document.createElement( 'div' ); - button.id = 'edit'; - button.textContent = 'EDIT'; - button.addEventListener( 'click', function ( event ) { - - var url = location.href.split( '/' ).slice( 0, - 1 ).join( '/' ); - window.open( 'http://threejs.org/editor/#file=' + url + '/app.json' ); - - }, false ); - document.body.appendChild( button ); - - } - window.addEventListener( 'resize', function () { player.setSize( window.innerWidth, window.innerHeight ); } );