Skip to content
This repository was archived by the owner on Jun 24, 2023. It is now read-only.

Add ThreeEventManager #39

Merged
merged 5 commits into from
Jan 13, 2023
Merged

Add ThreeEventManager #39

merged 5 commits into from
Jan 13, 2023

Conversation

krispya
Copy link
Member

@krispya krispya commented Jan 8, 2023

This adds ThreeEventManager which has a global pointer event system for the editor. Some notes:

  • This is completely ignore the R3F event manager. For the better, we no longer need to patch R3F events to work on its elements.
  • Currently only supports pointerdown and pointermissed, but I am happy to add new events as we see a need.
  • Events effect EditableElement. You can use the familiar addEventListener/removeEventListener api.
  • Right now, the event manager dispatches pointerdown events to all EditableElements, but only dispatches pointermissed to the root canvas. Note: there is a namespace collision between R3F roots and the editor root. See: The editor root namespace has collisions #37
  • Three layers have begun to be used. This is experimental, but offers benefits in that we save performance on skipping raycasting on any object in our exclude layer, but also we can begin to setup nice features like toggling on and off layers of objects. For example, gizmos or labels, like the Unity editor does.

@krispya krispya merged commit 8780ea0 into pmndrs:main Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant