use raycaster over aabb-collider for saber collisions

This commit is contained in:
Kevin Ngo
2018-11-04 19:28:10 +08:00
parent 0139133dc3
commit 36b7032418
7 changed files with 45 additions and 33 deletions

View File

@@ -13,13 +13,13 @@ AFRAME.registerComponent('wall', {
pause: function () {
this.el.object3D.visible = false;
this.el.removeAttribute('data-collidable-head');
this.el.removeAttribute('data-collidable-saber');
this.el.removeAttribute('raycastable-game');
},
play: function () {
this.el.object3D.visible = true;
this.el.setAttribute('data-collidable-head', '');
this.el.setAttribute('data-collidable-saber', '');
this.el.setAttribute('raycastable-game', '');
},
tock: function (time, delta) {
@@ -35,6 +35,6 @@ AFRAME.registerComponent('wall', {
this.el.object3D.position.z = 9999;
this.el.pause();
this.el.removeAttribute('data-collidable-head');
this.el.removeAttribute('data-collidable-saber');
this.el.removeAttribute('raycastable-game');
}
});