repo: janusweb action: commit revision: path_from: revision_from: 02fbfbfbf0557331f356cbcc7f0e4af37200b618: path_to: revision_to:
commit 02fbfbfbf0557331f356cbcc7f0e4af37200b618 Author: James BaicoianuDate: 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
--- 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
--- 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-----