@pixi/3d
    Preparing search index...

    Interface Wheel3DEvent

    A pixi.js FederatedWheelEvent with the 3D fields

    function onZoom(e: Wheel3DEvent): void {
    if (e.hit3D) zoomToward(e.hit3D.point, e.deltaY);
    }

    view3d.on('wheel', onZoom);
    interface Wheel3DEvent {
        currentTarget3D: Container3D | null;
        hit3D: RaycastHit3D | null;
        target3D: Container3D | null;
    }

    Hierarchy (View Summary)

    Index
    currentTarget3D: Container3D | null

    The 3D node whose listeners are running, or null outside the 3D dispatch

    The 3D counterpart of currentTarget: while target3D stays on the event's target, this moves from node to node, so an ancestor's listener reads the ancestor. The View's own listeners read null.

    // One listener on the group tells which node it fired on
    group.on('pointerdown', (e) => {
    // e.target3D is the node hit, or the group when that node isn't interactive
    console.log(e.currentTarget3D === group); // true
    });
    hit3D: RaycastHit3D | null

    What the pointer is over: the hit View3D#raycast would return for event.global, or null when the ray hits nothing

    It ignores which node is being told, so a pointerupoutside on the pressed node reports where the pointer was released, such as on a drop target, and a pointerout reports the node the pointer moved onto. It is null on the pointerout as the pointer leaves the View and on a release outside the View.

    ground.on('pointertap', (e) => {
    if (e.hit3D) marker.position.copyFrom(e.hit3D.point); // drop a marker where the ray landed
    });

    // Only per-triangle volumes carry surface data
    wall.hitVolume = 'geometry';
    wall.on('pointertap', (e) => {
    if (e.hit3D && e.hit3D.normal.y > 0.9) console.log('floor, not wall');
    });
    target3D: Container3D | null

    The 3D node this event is about, or null when it belongs to the View, as on a click on empty space

    The View's own listeners see the View as event.target, while target3D still names the node.

    • In a 3D node's *upoutside listeners it names the pressed node.
    • During pointerenter and pointerleave, which don't bubble, it names the node being told.
    • When the ray strikes a non-interactive ('auto' or 'passive') node, it names that node's nearest interactive ancestor.
    // One View-level listener instead of a listener per mesh
    view3d.on('pointertap', (e) => {
    if (e.target3D) select(e.target3D);
    else clearSelection();
    });