fixed wrist attachement with new hand API (1.3 to 1.4)

laser-fallback
Fabien Benetou 2 years ago
parent 699dbcd6b9
commit 4abc5ea939
  1. 2
      index.html

@ -930,7 +930,7 @@ AFRAME.registerComponent('wristattachsecondary',{
// localToWorld?
(primarySide == 0) ? secondarySide = 1 : secondarySide = 0
var worldPosition=this.worldPosition;
this.el.object3D.traverse( e => { if (e.name == "b_"+sides[secondarySide][0]+"_wrist") {
this.el.object3D.traverse( e => { if (e.name == "wrist") {
worldPosition.copy(e.position);e.parent.updateMatrixWorld();e.parent.localToWorld(worldPosition)
rotation = e.rotation.x*180/3.14 + " " + e.rotation.y*180/3.14 + " " + e.rotation.z*180/3.14
this.data.target.setAttribute("rotation", rotation)

Loading…
Cancel
Save