repo: janusweb action: commit revision: path_from: revision_from: c96bec1b9b133aea8b6bd96a5a6fe87e5e1d21ef: path_to: revision_to:
commit c96bec1b9b133aea8b6bd96a5a6fe87e5e1d21ef Author: James BaicoianuDate: Sun Apr 30 03:55:41 2017 -0700 Fix ghost head position diff --git a/scripts/janusghost.js b/scripts/janusghost.js
--- 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-----