Intersection Events
Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.
An intersection event is an event that is fired as a result of a Z.Raycaster node intersecting with a Z.Object node that both:
- includes the same
tag
value as the Raycaster node’scolliderTag
value, and - is within the
colliderLimit
of the Raycaster node.
There are six intersection events that are split between the Raycaster node itself, and the intersecting Z.Object node. They are as follows:
Event | Node | Description |
---|---|---|
intersectionenter | Z.Raycaster | When the Raycaster first intersects with an object. |
intersections | Z.Raycaster | Once a frame with data for every object currently intersected by the Raycaster. |
intersectionleave | Z.Raycaster | When the Raycaster is no longer intersecting with an object. |
intersectionenter | Z.Object | When the object is first intersected by a Raycaster. |
intersection | Z.Object | Once a frame for each Raycaster that the object is intersected by. |
intersectionleave | Z.Object | When the object is no longer being intersected by a Raycaster. |
Both
intersectionenter
events, along with Z.Raycaster’sintersections
, and Z.Object’sintersection
pass an IntersectionEvent argument to attached handler functions, providing further information on the intersection.