repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 4a7223ab76e510275d11b8311723083634db705c:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 4a7223ab76e510275d11b8311723083634db705c
Author: James Baicoianu 
Date:   Wed Sep 19 16:44:23 2018 -0700

    Room edit improvements, HiFi object spawning

diff --git a/scripts/room.js b/scripts/room.js
index 1a5211acbd808782ba4a8ca229fc845da96f5ce8..
index ..1f343bcd4de41da0cedfb3118b15d742f02ffb2d 100644
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -1910,6 +1910,12 @@ elation.require([
         var hashidx = urls[i].indexOf('#');
         let id = (hashidx == -1 ? urls[i] : urls[i].substring(0, hashidx)).trim();
         let type = 'Object';
+        let objargs = {
+          id: id,
+          js_id: player.userid + '-' + id + '-' + window.uniqueId(),
+          sync: true,
+          pos: player.vectors.cursor_pos.clone()
+        }
         if (id.length > 0) {
           var schemeidx = id.indexOf(':');
           if (schemeidx != -1) {
@@ -1921,16 +1927,20 @@ elation.require([
               type = 'light';
               if (id == 'point') {
                 // set up the point light
+                objargs.light_shadow = 'true';
               }
             }
           }
-          var newobject = this.createObject(type, {
-            id: id,
-            js_id: player.userid + '-' + id + '-' + window.uniqueId(),
-            sync: true,
-            pos: player.vectors.cursor_pos.clone()
-          });
-          objects.push(newobject);
+          if (typeof EventBridge != 'undefined') {
+            // if EventBridge is defined, we're (probably) running inside of High Fidelity, so just spawn this object
+            EventBridge.emitWebEvent(JSON.stringify({
+              type: 'spawn',
+              data: id
+            }));
+          } else {
+            var newobject = this.createObject(type, objargs);
+            objects.push(newobject);
+          }
         }
       }
       if (objects[0]) {

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