repo: janusweb
action: commit
revision: 
path_from: 
revision_from: e0826bb3f2b171493ba5f0c4284bdfe20e359b5b:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit e0826bb3f2b171493ba5f0c4284bdfe20e359b5b
Author: James Baicoianu 
Date:   Sun Dec 2 01:28:10 2018 -0800

    Added ghost showlabel attribute

diff --git a/scripts/janusghost.js b/scripts/janusghost.js
index a192838041af6befa3936a4cb6d199774a215106..
index ..1e54fbfe84c83eee2e9ef72493d0ec767e13d39d 100644
--- a/scripts/janusghost.js
+++ b/scripts/janusghost.js
@@ -10,6 +10,7 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
         head_pos: { type: 'vector3', default: [0,1,0] },
         body_id: { type: 'string' },
         lighting: { type: 'boolean', default: true, set: this.updateMaterial },
+        showlabel: { type: 'boolean', default: true },
         ghost_scale: { type: 'vector3', default: [1,1,1] },
         ghostassets: { type: 'object' },
         auto_play: { type: 'boolean', default: true },
@@ -69,16 +70,18 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
       this.setHead(this.head_id, this.properties.head_pos);
       this.setBody(this.body_id);
       var name = this.properties.ghost_id;
-      this.label = this.head.spawn('label', name + '_label', {
-        size: .1,
-        align: 'center',
-        collidable: false,
-        text: name,
-        position: [0,1.5,0],
-        orientation: [0,1,0,0],
-        pickable: false,
-        collidable: false
-      });
+      if (this.showlabel) {
+        this.label = this.head.spawn('label', name + '_label', {
+          size: .1,
+          align: 'center',
+          collidable: false,
+          text: name,
+          position: [0,1.5,0],
+          orientation: [0,1,0,0],
+          pickable: false,
+          collidable: false
+        });
+      }

       if (this.avatar_src) {
         elation.net.get(this.avatar_src, null, {
@@ -162,8 +165,10 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
         //this.head.properties.position.copy(headpos);
         if (scale) {
           this.face.scale.fromArray(scale);
-          this.label.scale.fromArray(scale);
-          this.label.properties.position.multiply(this.label.scale);
+          if (this.label) {
+            this.label.scale.fromArray(scale);
+            this.label.properties.position.multiply(this.label.scale);
+          }
         }
       }
     }

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