repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 02fbfbfbf0557331f356cbcc7f0e4af37200b618:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 02fbfbfbf0557331f356cbcc7f0e4af37200b618
Author: James Baicoianu 
Date:   Thu Apr 14 04:36:11 2016 -0700

    Move lights into room, add HTML class in elation.janusweb.init()

diff --git a/scripts/client.js b/scripts/client.js
index eca7227a22c295595ab8793e26ec721c86154c4e..
index ..ea2f641acc6bb08f0f40dbfa2dbadfb4638b88e9 100644
--- a/scripts/client.js
+++ b/scripts/client.js
@@ -5,6 +5,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.player', 'engi
     link.rel = 'stylesheet';
     link.href = host + 'janusweb.css';
     document.head.appendChild(link);
+    elation.html.addclass(document.body, 'dark');
     var janusweb = elation.janusweb.client({append: document.body, homepage: document.location.href});
     return janusweb;
   });
@@ -33,29 +34,6 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.player', 'engi
           homepage: this.args.homepage
         },
         things: {
-          ambient: {
-            name: 'ambient',
-            type: 'light_ambient',
-            properties: {
-              color: 0x222222
-            }
-          },
-          sun: {
-            name: 'sun',
-            type: 'light_directional',
-            properties: {
-              position: [-20,50,25],
-              intensity: 0.2
-            }
-          },
-          point: {
-            name: 'point01',
-            type: 'light_point',
-            properties: {
-              position: [22,19,-15],
-              intensity: 0.2
-            }
-          },
           player: {
             name: 'player',
             type: 'player',
diff --git a/scripts/room.js b/scripts/room.js
index 88aeab0f36e31488ef16877d5aafef9fc0c0406c..
index ..8d503231b8554be5528bd8abd03f65c198d5972a 100644
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -29,6 +29,19 @@ elation.require([
       this.roomsrc = '';
       //this.showDebug();
     }
+    this.createChildren = function() {
+      this.spawn('light_ambient', this.id + '_ambient', {
+        color: 0x222222
+      });
+      this.spawn('light_directional', this.id + '_sun', {
+        position: [-20,50,25],
+        intensity: 0.2
+      });
+      this.spawn('light_point', this.id + '_point', {
+        position: [22,19,-15],
+        intensity: 0.2
+      });
+    }
     this.setActive = function() {
       this.setSkybox();
       this.setFog();
@@ -423,7 +436,7 @@ elation.require([
       }));

       // set player position based on room info
-      this.playerstartposition = roomnode.pos;
+      this.playerstartposition = roomnode.pos.map(parseFloat);
       this.playerstartorientation = roomnode.orientation;

       if (room.skybox_left_id) this.properties.skybox_left = room.skybox_left_id;

-----END OF PAGE-----