Interface contract for objects that can respond to pointer interactions.
Description
Defines the required structure for Three.js objects to become interactive
within the MouseEventManager system. Objects implementing this interface
can receive pointer events (mouse, touch, pen) and respond appropriately
through their associated ButtonInteractionHandler.
Implementation Requirements:
Objects must provide an interactionHandler property that implements
ButtonInteractionHandler. This handler manages the object's interaction
behavior, state transitions, and event emission.
Detection Mechanism:
MouseEventManager uses this interface to identify interactive objects
during raycasting. Objects are validated using a type guard that checks
for the presence and structure of the interactionHandler property.
// Creating an interactive object by implementing the interface classMyInteractiveMeshextendsMeshimplementsIClickableObject3D<string> { publicreadonlyinteractionHandler: ButtonInteractionHandler<string>;
The interaction handler that manages this object's pointer event responses.
Description
This handler is responsible for processing pointer events, managing interaction
states, updating visual materials, and emitting appropriate events. It serves
as the bridge between the MouseEventManager's event detection and the object's
behavioral responses.
Interface contract for objects that can respond to pointer interactions.
Description
Defines the required structure for Three.js objects to become interactive within the MouseEventManager system. Objects implementing this interface can receive pointer events (mouse, touch, pen) and respond appropriately through their associated ButtonInteractionHandler.
Implementation Requirements: Objects must provide an
interactionHandler
property that implements ButtonInteractionHandler. This handler manages the object's interaction behavior, state transitions, and event emission.Detection Mechanism: MouseEventManager uses this interface to identify interactive objects during raycasting. Objects are validated using a type guard that checks for the presence and structure of the interactionHandler property.
Example
Remarks
See