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.beatsHeadStart -= delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lastTime = lastTime + delta;
|
this.lastTime = lastTime + delta;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
AFRAME.registerComponent('trail', {
|
AFRAME.registerComponent('trail', {
|
||||||
schema: {
|
schema: {
|
||||||
color: {type: 'color'},
|
color: {type: 'color'},
|
||||||
enabled: {default: false}
|
enabled: {default: false},
|
||||||
|
hand: {type: 'string'}
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
@@ -61,7 +62,7 @@ AFRAME.registerComponent('trail', {
|
|||||||
mesh.vertices = vertices;
|
mesh.vertices = vertices;
|
||||||
//mesh.scale.set(0.4, 0.4, 0.4);
|
//mesh.scale.set(0.4, 0.4, 0.4);
|
||||||
//mesh.rotation.set(0, 0, Math.PI / 2.0);
|
//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) {
|
addLayer: function (length) {
|
||||||
|
|||||||
@@ -136,7 +136,7 @@
|
|||||||
saber-controls="hand: {{ hand }}"
|
saber-controls="hand: {{ hand }}"
|
||||||
thumb-controls
|
thumb-controls
|
||||||
thumb-controls-debug="enabled: false; hand: {{ hand }}; controllerType: vive-controls"
|
thumb-controls-debug="enabled: false; hand: {{ hand }}; controllerType: vive-controls"
|
||||||
trail="color: {{ bladeColor }}">
|
trail="color: {{ bladeColor }}; hand: {{ hand }}">
|
||||||
<a-entity
|
<a-entity
|
||||||
id="{{ hand }}Laser"
|
id="{{ hand }}Laser"
|
||||||
bind__visible="activeHand === '{{ hand }}'"
|
bind__visible="activeHand === '{{ hand }}'"
|
||||||
|
|||||||
Reference in New Issue
Block a user