@masatomakino/threejs-interactive-object
    Preparing search index...

    Function cloneThreeMouseEvent

    Use named exports directly from "@masatomakino/threejs-interactive-object" instead.

    • Creates a copy of an existing ThreeMouseEvent.

      Type Parameters

      • Value

      Parameters

      Returns ThreeMouseEvent<Value>

      New ThreeMouseEvent with the same type, handler reference, and pointerId

      Clones a ThreeMouseEvent by regenerating it using the original event's type, interaction handler, and pointerId. Selection state is recalculated from current handler state, which may differ from the original if selection changed.

      const originalEvent = createThreeMouseEvent("select", checkbox, 2);
      const clonedEvent = cloneThreeMouseEvent(originalEvent);

      // Events have same structure but selection state reflects current handler
      // state
      console.log(originalEvent.type === clonedEvent.type); // true
      console.log(originalEvent.pointerId === clonedEvent.pointerId); // true
      console.log(originalEvent.interactionHandler === clonedEvent.interactionHandler);
      // true

      createThreeMouseEvent - Primary event creation function