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

    Function createThreeMouseEvent

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

    • Creates a ThreeMouseEvent with the specified type and source.

      Type Parameters

      • Value

      Parameters

      Returns ThreeMouseEvent<Value>

      Fully populated ThreeMouseEvent object

      Primary factory function for creating ThreeMouseEvent objects. Automatically populates the isSelected property for "select" events by querying handler selection state. For other event types, isSelected remains undefined. The pointerId defaults to 1 for backward compatibility.

      // Create click event from button (default pointerId = 1)
      const clickEvent = createThreeMouseEvent("click", button.interactionHandler);
      console.log(clickEvent.type); // "click"
      console.log(clickEvent.pointerId); // 1
      console.log(clickEvent.isSelected); // undefined

      // Create select event from checkbox with custom pointerId
      const selectEvent = createThreeMouseEvent("select", checkbox, 2);
      console.log(selectEvent.type); // "select"
      console.log(selectEvent.pointerId); // 2
      console.log(selectEvent.isSelected); // true/false