repo: janusweb action: commit revision: path_from: revision_from: 5e025fc05d1a5b74e25afabd124b5ace600861f9: path_to: revision_to:
commit 5e025fc05d1a5b74e25afabd124b5ace600861f9 Author: James BaicoianuDate: Tue Oct 9 14:38:49 2018 -0700 Leap motion hand fixes diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -228,11 +228,11 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
}
if (hands.left.fingers) {
- this.hands.left.p0.copy(hands.left.fingers[0].fingertip.getWorldPosition());
- this.hands.left.p1.copy(hands.left.fingers[1].fingertip.getWorldPosition());
- this.hands.left.p2.copy(hands.left.fingers[2].fingertip.getWorldPosition());
- this.hands.left.p3.copy(hands.left.fingers[3].fingertip.getWorldPosition());
- this.hands.left.p4.copy(hands.left.fingers[4].fingertip.getWorldPosition());
+ hands.left.fingers[0].fingertip.getWorldPosition(this.hands.left.p0);
+ hands.left.fingers[1].fingertip.getWorldPosition(this.hands.left.p1);
+ hands.left.fingers[2].fingertip.getWorldPosition(this.hands.left.p2);
+ hands.left.fingers[3].fingertip.getWorldPosition(this.hands.left.p3);
+ hands.left.fingers[4].fingertip.getWorldPosition(this.hands.left.p4);
}
}
if (hands.right && hands.right.position) {
@@ -255,11 +255,11 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
}
if (hands.right.fingers) {
- this.hands.right.p0.copy(hands.right.fingers[0].fingertip.getWorldPosition());
- this.hands.right.p1.copy(hands.right.fingers[1].fingertip.getWorldPosition());
- this.hands.right.p2.copy(hands.right.fingers[2].fingertip.getWorldPosition());
- this.hands.right.p3.copy(hands.right.fingers[3].fingertip.getWorldPosition());
- this.hands.right.p4.copy(hands.right.fingers[4].fingertip.getWorldPosition());
+ hands.right.fingers[0].fingertip.getWorldPosition(this.hands.right.p0);
+ hands.right.fingers[1].fingertip.getWorldPosition(this.hands.right.p1);
+ hands.right.fingers[2].fingertip.getWorldPosition(this.hands.right.p2);
+ hands.right.fingers[3].fingertip.getWorldPosition(this.hands.right.p3);
+ hands.right.fingers[4].fingertip.getWorldPosition(this.hands.right.p4);
}
}
}
@@ -330,6 +330,8 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
}
}
}
+ this.objects['3d'].updateMatrix();
+ this.objects['3d'].updateMatrixWorld();
this.camera.objects['3d'].updateMatrix();
this.camera.objects['3d'].updateMatrixWorld();
}
@@ -337,6 +339,8 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
this.updateVectors = function() {
var v = this.vectors;
if (this.objects['3d']) {
+ this.objects['3d'].updateMatrix();
+ this.objects['3d'].updateMatrixWorld();
this.objects['3d'].matrixWorld.extractBasis(v.xdir, v.ydir, v.zdir)
}
if (this.head) {
-----END OF PAGE-----