fix not being to have more than one trail in scene (fixes #80)

This commit is contained in:
Kevin Ngo
2018-10-10 04:32:21 -07:00
parent cd36389842
commit ec256a76ba
3 changed files with 5 additions and 4 deletions

View File

@@ -122,7 +122,7 @@ AFRAME.registerComponent('beat-loader', {
this.beatsHeadStart -= delta;
}
}
this.lastTime = lastTime + delta;
},

View File

@@ -1,7 +1,8 @@
AFRAME.registerComponent('trail', {
schema: {
color: {type: 'color'},
enabled: {default: false}
enabled: {default: false},
hand: {type: 'string'}
},
init: function () {
@@ -61,7 +62,7 @@ AFRAME.registerComponent('trail', {
mesh.vertices = vertices;
//mesh.scale.set(0.4, 0.4, 0.4);
//mesh.rotation.set(0, 0, Math.PI / 2.0);
this.el.sceneEl.setObject3D('trail', mesh);
this.el.sceneEl.setObject3D(`trail__${this.data.hand}`, mesh);
},
addLayer: function (length) {

View File

@@ -136,7 +136,7 @@
saber-controls="hand: {{ hand }}"
thumb-controls
thumb-controls-debug="enabled: false; hand: {{ hand }}; controllerType: vive-controls"
trail="color: {{ bladeColor }}">
trail="color: {{ bladeColor }}; hand: {{ hand }}">
<a-entity
id="{{ hand }}Laser"
bind__visible="activeHand === '{{ hand }}'"