Nikolay Suslov 4 jaren geleden
bovenliggende
commit
bb2f8ff904
1 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  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 { }