fix not being to have more than one trail in scene (fixes #80)
This commit is contained in:
@@ -122,7 +122,7 @@ AFRAME.registerComponent('beat-loader', {
|
||||
this.beatsHeadStart -= delta;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.lastTime = lastTime + delta;
|
||||
},
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 }}'"
|
||||
|
||||
Reference in New Issue
Block a user