You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproducible Code Snippet or URL: None. Can create if needed.
Raycaster documentation says that the raycaster-intersection event is generated as follows:
raycaster-intersection | Emitted on the raycasting entity. Raycaster is intersecting with one or more entities. Event detail will contain els, an array with the intersected entities, and intersections, and .getIntersection (el) function which can be used to obtain current intersection data.
// Emit all intersections at once on raycasting entity.
if (newIntersections.length) {
this.intersectionDetail.els = newIntersectedEls;
this.intersectionDetail.intersections = newIntersections;
el.emit(EVENTS.INTERSECTION, this.intersectionDetail);
}
It only includes new intersections in the event, rather than all current intersections, missing out any previous intersections.
We should fix either the code or the docs, so they are consistent.
I suspect the current implementation (code) actually gives more flexibility.
If you want to know all the currentl intersecting elements, raycaster.intersectedEls is a documented part of the public interface of raycaster (https://aframe.io/docs/1.2.0/components/raycaster.html#members), so you can get it direct from there, and don't need it on the event.
The set of newly intersected elements could be useful info for an application, and it's info the application wouldn't otherwise have access to.
On top of that, changing code would risk breaking existing code.
So I think the best fix is to fix up the docs. Trivial change, so I'll create a PR.
The text was updated successfully, but these errors were encountered:
Description:
Raycaster documentation says that the raycaster-intersection event is generated as follows:
https://aframe.io/docs/1.2.0/components/raycaster.html#events
However this is not what the code does for new intersections:
https://github.com/aframevr/aframe/blob/v1.2.0/src/components/raycaster.js#L272
It only includes new intersections in the event, rather than all current intersections, missing out any previous intersections.
We should fix either the code or the docs, so they are consistent.
I suspect the current implementation (code) actually gives more flexibility.
If you want to know all the currentl intersecting elements, raycaster.intersectedEls is a documented part of the public interface of raycaster (https://aframe.io/docs/1.2.0/components/raycaster.html#members), so you can get it direct from there, and don't need it on the event.
The set of newly intersected elements could be useful info for an application, and it's info the application wouldn't otherwise have access to.
On top of that, changing code would risk breaking existing code.
So I think the best fix is to fix up the docs. Trivial change, so I'll create a PR.
The text was updated successfully, but these errors were encountered: