intersectionenter
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.
("intersectionenter", (IntersectionEvent) => void): this;
Emitted when the object is first intersected by a raycaster.
Returns
Section titled “Returns”this
Handler Function
Section titled “Handler Function”When the intersectionenter
event is fired, attached handler functions are called with a single argument, an IntersectionEvent.
Example
Section titled “Example”symbol.nodes.Plane.on("intersectionenter", (e) => { // Runs when intersectionenter 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;});