use raycaster over aabb-collider for saber collisions
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
AFRAME.registerComponent('cursor-laser', {
|
||||
dependencies: ['geometry'],
|
||||
|
||||
schema: {
|
||||
enabled: {default: true}
|
||||
},
|
||||
|
||||
init: function () {
|
||||
const el = this.el;
|
||||
const box = new THREE.Box3();
|
||||
@@ -21,9 +25,15 @@ AFRAME.registerComponent('cursor-laser', {
|
||||
this.currentLength = size.y;
|
||||
},
|
||||
|
||||
update: function () {
|
||||
this.el.object3D.visible = this.data.enabled;
|
||||
},
|
||||
|
||||
tick: function () {
|
||||
const el = this.el;
|
||||
|
||||
if (!this.data.enabled) { return; }
|
||||
|
||||
const cursor = el.parentNode.components.cursor;
|
||||
if (!cursor) { return; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user