Creates a ThreeMouseEvent with the specified type and source.
Event type from ThreeMouseEventMap (click, down, up, over, out, select)
Source handler or interactive view object for the event
Pointer identifier for multitouch support (defaults to 1)
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
Deprecated
Use named exports directly from "@masatomakino/threejs-interactive-object" instead.