diff --git a/browser-interface/.gitignore b/browser-interface/.gitignore index bafc1b43a7..6ece25fc01 100644 --- a/browser-interface/.gitignore +++ b/browser-interface/.gitignore @@ -46,7 +46,7 @@ node_modules/ npm-debug.log .DS_Store static/dist -public/systems +public/empty-scenes/common/contents static/systems static/loader static/lifecycle diff --git a/browser-interface/public/empty-scenes/common/contents/EP_01.js b/browser-interface/public/empty-scenes/common/contents/EP_01.js deleted file mode 100644 index b48e43b396..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_01.js +++ /dev/null @@ -1,71 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - - - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_01.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_02.js b/browser-interface/public/empty-scenes/common/contents/EP_02.js deleted file mode 100644 index 612f2fce61..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_02.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_02.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_03.js b/browser-interface/public/empty-scenes/common/contents/EP_03.js deleted file mode 100644 index ff7c29d1bd..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_03.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_03.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_04.js b/browser-interface/public/empty-scenes/common/contents/EP_04.js deleted file mode 100644 index 457baeadb7..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_04.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_04.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_05.js b/browser-interface/public/empty-scenes/common/contents/EP_05.js deleted file mode 100644 index 6ad8dbbeba..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_05.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_05.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_06.js b/browser-interface/public/empty-scenes/common/contents/EP_06.js deleted file mode 100644 index e45b7f9947..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_06.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_06.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_07.js b/browser-interface/public/empty-scenes/common/contents/EP_07.js deleted file mode 100644 index 8b702febc2..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_07.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_07.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_08.js b/browser-interface/public/empty-scenes/common/contents/EP_08.js deleted file mode 100644 index 3e3b5bb422..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_08.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_08.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_09.js b/browser-interface/public/empty-scenes/common/contents/EP_09.js deleted file mode 100644 index c1c674b102..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_09.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_09.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_10.js b/browser-interface/public/empty-scenes/common/contents/EP_10.js deleted file mode 100644 index 079b8d9539..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_10.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_10.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_11.js b/browser-interface/public/empty-scenes/common/contents/EP_11.js deleted file mode 100644 index b9f06e1718..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_11.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_11.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/EP_12.js b/browser-interface/public/empty-scenes/common/contents/EP_12.js deleted file mode 100644 index 7aa5dffa77..0000000000 --- a/browser-interface/public/empty-scenes/common/contents/EP_12.js +++ /dev/null @@ -1,69 +0,0 @@ - -dcl.subscribe('sceneStart') - -function Vector3(x, y, z) { - return { x, y, z } -} -function Quaternion(x, y, z, w) { - return { x, y, z, w } -} -function Transform(transformData) { - return transformData -} -function GLTFShape(url) { - return { src: url } -} -const ids = {} -function normalEntityId(id) { - if (!ids[id]) { - ids[id] = (Object.keys(ids).length + 1).toString(10) - } - return ids[id] -} -function Entity(id) { - this.id = normalEntityId(id) - return this -} -Entity.prototype.setParent = function(parent) { - dcl.setParent(this.id, parent.id) -} -Entity.prototype.addComponentOrReplace = function(component) { - if (component.position && component.rotation && component.scale) { - dcl.updateEntityComponent(this.id, 'engine.transform', 1, JSON.stringify(component)) - } else if (component.src) { - dcl.componentCreated('gl_' + this.id, 'engine.shape', 54) - dcl.componentUpdated('gl_' + this.id, JSON.stringify(component)) - dcl.attachEntityComponent(this.id, 'engine.shape', 'gl_' + this.id) - } -} -var engine = { - addEntity: function(entity) { - dcl.addEntity(entity.id) - if (entity.id === "1") { - dcl.setParent(entity.id, "0") - } - } -} - -const _scene = new Entity('_scene') -engine.addEntity(_scene) -const transform = new Transform({ - position: new Vector3(0, 0, 0), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -_scene.addComponentOrReplace(transform) - -const ep = new Entity('ep') -engine.addEntity(ep) -ep.setParent(_scene) -const transform3 = new Transform({ - position: new Vector3(8, 0, 8), - rotation: new Quaternion(0, 0, 0, 1), - scale: new Vector3(1, 1, 1) -}) -ep.addComponentOrReplace(transform3) -const gltfShape2 = new GLTFShape("models/EP_12.glb") -gltfShape2.withCollisions = true -gltfShape2.visible = true -ep.addComponentOrReplace(gltfShape2) diff --git a/browser-interface/public/empty-scenes/common/contents/QmPMDiyccNRLXQgHeyFi6tibXm8kP3A6DcTjq2bSsnN8D7 b/browser-interface/public/empty-scenes/common/contents/QmPMDiyccNRLXQgHeyFi6tibXm8kP3A6DcTjq2bSsnN8D7 deleted file mode 100755 index b91d05c29a..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmPMDiyccNRLXQgHeyFi6tibXm8kP3A6DcTjq2bSsnN8D7 and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmPNiWeuf2xDJJy6zGteBpad6xMeYZ58Zqyx6U5id4b758 b/browser-interface/public/empty-scenes/common/contents/QmPNiWeuf2xDJJy6zGteBpad6xMeYZ58Zqyx6U5id4b758 deleted file mode 100755 index 15957f0e40..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmPNiWeuf2xDJJy6zGteBpad6xMeYZ58Zqyx6U5id4b758 and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmQyeu5ZjFzJFZ2bz4zdYX8yjRFS1QqCg4CF67XuQc31Uw b/browser-interface/public/empty-scenes/common/contents/QmQyeu5ZjFzJFZ2bz4zdYX8yjRFS1QqCg4CF67XuQc31Uw deleted file mode 100755 index 35ffeb3fe6..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmQyeu5ZjFzJFZ2bz4zdYX8yjRFS1QqCg4CF67XuQc31Uw and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmSyvWnb5nKCaGHw9oHLSkwywvS5NYpj6vgb8L121kWveS b/browser-interface/public/empty-scenes/common/contents/QmSyvWnb5nKCaGHw9oHLSkwywvS5NYpj6vgb8L121kWveS deleted file mode 100755 index f466307e38..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmSyvWnb5nKCaGHw9oHLSkwywvS5NYpj6vgb8L121kWveS and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmT1WfQPMBVhgwyxV5SfcfWivZ6hqMCT74nxdKXwyZBiXb b/browser-interface/public/empty-scenes/common/contents/QmT1WfQPMBVhgwyxV5SfcfWivZ6hqMCT74nxdKXwyZBiXb deleted file mode 100755 index f104c14989..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmT1WfQPMBVhgwyxV5SfcfWivZ6hqMCT74nxdKXwyZBiXb and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmTsvnJp8R2yrdADusiMXHdHjNe7PDr4SaPRd9Y6S1zLku b/browser-interface/public/empty-scenes/common/contents/QmTsvnJp8R2yrdADusiMXHdHjNe7PDr4SaPRd9Y6S1zLku deleted file mode 100755 index 41e6d1ff09..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmTsvnJp8R2yrdADusiMXHdHjNe7PDr4SaPRd9Y6S1zLku and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmUschpqQoMRLK4BFme5TmHb1HYEAxCGBqdnLpXKVXbxFZ b/browser-interface/public/empty-scenes/common/contents/QmUschpqQoMRLK4BFme5TmHb1HYEAxCGBqdnLpXKVXbxFZ deleted file mode 100755 index 0581aafde6..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmUschpqQoMRLK4BFme5TmHb1HYEAxCGBqdnLpXKVXbxFZ and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmV5WtLZ6KsaNvKoGm6rEt6TQGVHvLg58iDDyniAwp5MXM b/browser-interface/public/empty-scenes/common/contents/QmV5WtLZ6KsaNvKoGm6rEt6TQGVHvLg58iDDyniAwp5MXM deleted file mode 100755 index 917f5c60c1..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmV5WtLZ6KsaNvKoGm6rEt6TQGVHvLg58iDDyniAwp5MXM and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmWrgVvGLrpNtXjVJC7VAwyqmnHMF9uc5hHnW1hP93ooVa b/browser-interface/public/empty-scenes/common/contents/QmWrgVvGLrpNtXjVJC7VAwyqmnHMF9uc5hHnW1hP93ooVa deleted file mode 100755 index f8fe5f3ff5..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmWrgVvGLrpNtXjVJC7VAwyqmnHMF9uc5hHnW1hP93ooVa and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmX4bcPybJchnjs6mtEyJJrmvs8R6Yf1ZY7goM4xnDxWAa b/browser-interface/public/empty-scenes/common/contents/QmX4bcPybJchnjs6mtEyJJrmvs8R6Yf1ZY7goM4xnDxWAa deleted file mode 100755 index 8da88e3402..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmX4bcPybJchnjs6mtEyJJrmvs8R6Yf1ZY7goM4xnDxWAa and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/Qma1cw8Ln8if6MsKy8E2wj2fTddDDktvJvEhjuJLHAo1Ws b/browser-interface/public/empty-scenes/common/contents/Qma1cw8Ln8if6MsKy8E2wj2fTddDDktvJvEhjuJLHAo1Ws deleted file mode 100755 index 743ee428b7..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/Qma1cw8Ln8if6MsKy8E2wj2fTddDDktvJvEhjuJLHAo1Ws and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/Qma9aXnxq2jBvfiKj2374cUWvdJZnS6LoHkbojBq3NfxKQ b/browser-interface/public/empty-scenes/common/contents/Qma9aXnxq2jBvfiKj2374cUWvdJZnS6LoHkbojBq3NfxKQ deleted file mode 100755 index 929a5000eb..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/Qma9aXnxq2jBvfiKj2374cUWvdJZnS6LoHkbojBq3NfxKQ and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmbhQnr6VavXXPVjjwhCaJqRQDkGAg81UpiV5AYVTorNim b/browser-interface/public/empty-scenes/common/contents/QmbhQnr6VavXXPVjjwhCaJqRQDkGAg81UpiV5AYVTorNim deleted file mode 100755 index f36dbde24d..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmbhQnr6VavXXPVjjwhCaJqRQDkGAg81UpiV5AYVTorNim and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmcyG3AGHXScmQrULP7cKXjuvnQtqydHwvgQMHKRhYGfTA b/browser-interface/public/empty-scenes/common/contents/QmcyG3AGHXScmQrULP7cKXjuvnQtqydHwvgQMHKRhYGfTA deleted file mode 100755 index d45d84978a..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmcyG3AGHXScmQrULP7cKXjuvnQtqydHwvgQMHKRhYGfTA and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/contents/QmexuPHcbEtQCR11dPXxKZmRjGuY4iTooPJYfST7hW71DE b/browser-interface/public/empty-scenes/common/contents/QmexuPHcbEtQCR11dPXxKZmRjGuY4iTooPJYfST7hW71DE deleted file mode 100755 index 44c21a4108..0000000000 Binary files a/browser-interface/public/empty-scenes/common/contents/QmexuPHcbEtQCR11dPXxKZmRjGuY4iTooPJYfST7hW71DE and /dev/null differ diff --git a/browser-interface/public/empty-scenes/common/generate_all.js b/browser-interface/public/empty-scenes/common/generate_all.js index 40b315546d..6dc9c6734b 100644 --- a/browser-interface/public/empty-scenes/common/generate_all.js +++ b/browser-interface/public/empty-scenes/common/generate_all.js @@ -36,16 +36,18 @@ for (let dir of dirs) { } } } + let sourceFile = path.join(__dirname, dir, 'src/game.ts') + let targetFile = path.join(__dirname, 'contents', dir + '.js') if ( fs - .readFileSync(path.join(__dirname, dir, 'bin/game.js')) + .readFileSync(sourceFile) .toString() .startsWith('dcl.subscribe') ) { - fs.copyFileSync(path.join(__dirname, dir, 'bin/game.js'), path.join(__dirname, 'contents', dir + '.js')) + fs.copyFileSync(sourceFile, targetFile) } else { fs.writeFileSync( - path.join(__dirname, 'contents', dir + '.js'), + targetFile, ` dcl.subscribe('sceneStart') @@ -91,7 +93,7 @@ var engine = { dcl.setParent(entity.id, "0") } } -}\n` + fs.readFileSync(path.join(__dirname, dir, 'bin/game.js')).toString() +}\n` + fs.readFileSync(sourceFile).toString() ) } data[dir] = sceneMappings