intersection
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.
("intersection", (IntersectionEvent) => void): this;
Emitted every frame for each raycaster that the object is intersected by.
Returns
Section titled “Returns”this
Handler Function
Section titled “Handler Function”When the intersection
event is fired, attached handler functions are called with a single argument, an IntersectionEvent.
Example
Section titled “Example”symbol.nodes.Plane.on("intersection", (e) => { // Runs when intersection occurs on the Plane node // The argument e contains useful info about this event:
// Stores the distance from the raycaster to this object in the raycaster's coordinate system var raycasterDistance = e.distance;
// Stores the raycaster colliding with this object var raycaster = e.raycaster;
// Stores the localPosition of the collision point [x,y,z] in the object's local coordinate system var localPosition = e.localPosition;});