Nikolay Suslov 4 лет назад
Родитель
Сommit
bb2f8ff904
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      public/drivers/model/aframe/addon/aframe-components.js

+ 4 - 3
public/drivers/model/aframe/addon/aframe-components.js

@@ -509,8 +509,9 @@ AFRAME.registerComponent('raycaster-listener', {
                 if (self.intersected) {
 
                 } else {
-                    console.log('I was intersected at: ', evt.target);//evt.detail.getIntersection().point);
-                    vwf_view.kernel.fireEvent(evt.target.id, "intersectEvent");
+                    let point = evt.detail.getIntersection(evt.target).point;
+                    console.log('I was intersected at: ', evt.target, ' point: ', point);//evt.detail.getIntersection().point);
+                    vwf.callMethod(evt.target.id, "intersectEventMethod", [point]);
                 }
 
                 self.casters[evt.target.id] = evt.target;
@@ -529,7 +530,7 @@ AFRAME.registerComponent('raycaster-listener', {
                 if (self.intersected) {
                     console.log('Clear intersection');
                     if (Object.entries(self.casters).length == 1 && (self.casters[evt.target.id] !== undefined)) {
-                        vwf_view.kernel.fireEvent(evt.target.id, "clearIntersectEvent")
+                        vwf.callMethod(evt.target.id, "clearIntersectEventMethod", [])
                     }
                     delete self.casters[evt.target.id]
                 } else { }