repo: janusweb
action: commit
revision: 
path_from: 
revision_from: c96bec1b9b133aea8b6bd96a5a6fe87e5e1d21ef:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit c96bec1b9b133aea8b6bd96a5a6fe87e5e1d21ef
Author: James Baicoianu 
Date:   Sun Apr 30 03:55:41 2017 -0700

    Fix ghost head position

diff --git a/scripts/janusghost.js b/scripts/janusghost.js
index ab2fa15de1ed2b2e8dfc04ca6c4217be141d7713..
index ..6229835976461271591c4cdb6d6974f29f7f32f3 100644
--- a/scripts/janusghost.js
+++ b/scripts/janusghost.js
@@ -38,6 +38,8 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
       );
     }
     this.createChildren = function() {
+      elation.engine.things.janusghost.extendclass.createChildren.call(this);
+
       this.head = this.spawn('generic', null, { position: new THREE.Vector3() });
       this.shoulders = this.spawn('generic', this.properties.player_id + '_shoulders', {
         'position': [0,1.0,0]
@@ -215,7 +217,7 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
               var headpos = this.head.properties.position;
               var facepos = this.face.properties.position;
               var newpos = parser.getVectorValue(movedata.head_pos);
-              headpos.fromArray(newpos);
+              headpos.fromArray(newpos).add(this.head_pos);
               facepos.fromArray([-newpos[0], -newpos[1], -newpos[2]]).sub(this.properties.head_pos);
             }
           }

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