Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(events)!: pointerevents manager and state #529

Merged
merged 19 commits into from Apr 22, 2024

Commits on Feb 1, 2024

  1. new file: playground/src/components/Box.vue

    	new file:   playground/src/pages/raycaster/Propogation.vue
    	  * Started work on interactive Event Propogation playground example
    	modified:   src/components/TresCanvas.vue
    	  * Import and use `useEventStore`
    	  * defineEmits for all expected pointer events so we may emit propogated events off of the canvasa
    	modified:   src/composables/index.ts
    	new file:   src/composables/useEventStore/index.ts
    	  * Started work on an event store. I'm not sure this counts as a store just yet
    	  * Wired up majority of pointer events
    	  * Added event propogation
    	  * Does not require using userData scene props or nodeOps for registering objects to scene
    	modified:   src/composables/useRaycaster/index.ts
    	  * Added new event listeners to power newly supported pointer events. We now check whole scene/children when calling intersectObjects.
    	  * Created new EventHooks for new events
    	  * Added `forceUpdate` function that allows for pointer-move events to work without mouth movement (good for when camera is moving but mouse is not)
    
    	modified:   src/core/nodeOps.ts
    	  * Added supported events to array so they don't get received as props
    	  * (temporarily) unhook current pointer event solution to iterate on useEventStore
    	modified:   src/utils/index.ts
    	  * Added Camel-to-kebab case util
    garrlker committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    4ef245b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1a491da View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    580029d View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2024

  1. fix typo

    garrlker committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    56776ae View commit details
    Browse the repository at this point in the history
  2. fix: remove createGlobalState from useEventStore, allowing events…

    … to work while multiple TresCanvas' are being used
    garrlker committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    de9f843 View commit details
    Browse the repository at this point in the history
  3. fix(perf): remove extraneous intersectObjects/getIntersects calls by …

    …moving intersects into a ref that is updated on pointer-move
    garrlker committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    d42feb3 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Configuration menu
    Copy the full SHA
    50dcaed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7783233 View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2024

  1. feat: enhance events manager to include duplicates checking, pointer-…

    …missed support, and forced updating
    
    Per file changelog:
    	modified:   playground/src/components/Box.vue
    	  * Added a pointer-missed handler for testing
    	modified:   playground/src/pages/TheBasic.vue
    	  * uses forceUpdate from EventManager to fire events even when the mouse hasn't moved
    	modified:   playground/src/pages/raycaster/Propagation.vue
    	  * Didn't mean to undo the lint changes, adds a pointer-missed event on the canvas 		for extra testing
    	modified:   src/components/TresCanvas.vue
    	  * Adds `pointer-missed` as possible event for canvas emits
    	modified:   src/composables/index.ts
    	  * Update export
    	deleted:    src/composables/useEventStore/index.ts
    	  * Rename `useEventStore` to `useTresEventManager`
    	modified:   src/composables/useRaycaster/index.ts
    	  * Check for empty intersects on hit test, wire up pointerMissed events eventHook
    	  * Fix forceUpdate to call onPointerMove instead of triggering an EventHook
    	modified:   src/composables/useTresContextProvider/index.ts
    	  * Add TresEventManager type
    	new file:   src/composables/useTresEventManager/index.ts
    	  * add onPointerMissed
    	  * create (de)registerPointerMissedObj methods so we can track objects in the scene listening to this event
    	  * Note: These are passed to nodeOps via TresContext
    	  * Implement duplicates checking for eventPropogation
    	modified:   src/core/nodeOps.ts
    	  * register/deregister pointerMissed objects
    garrlker committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    8a6f0a1 View commit details
    Browse the repository at this point in the history
  2. chore: lint

    garrlker committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    b5124ca View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2024

  1. Configuration menu
    Copy the full SHA
    a251b05 View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. docs: new event docs

    alvarosabu committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    199c654 View commit details
    Browse the repository at this point in the history
  2. chore: fix lint

    alvarosabu committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    8f8ba50 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. feat: enhance event object details and use in Box example to change m…

    …aterial color. Add ability to force event system updates even when mouse hasn't moved. Enhance pointer-enter/leave events. Update types
    
      Box.vue
        * Added pointer-missed handler
        * set the materials flash color using the object coming off of the event instead of a ref
      UseRaycaster
        * Flesh out event details to include
          * all mouse event properties
          * intersections
          * tres camera
          * camera raycaster
          * source event
          * mouse position delta
          * stopPropagating stub
          * and unprojectedPoint (this needs work, cant get the math to work)
      UseTresContextProvider
        * Add TresEventManager type to TresContext
      useTresEventManager
        * Add forceUpdate method to allow apps to force an event system update even when the mouse hasnt moved
        * Add pointerMissed event
        * Properly implement pointer-enter/pointer-leave events
          * Before now, pointer-enter | leave were only called on first object in intersection, now we execute the events for all entered/left objects
        * Use stopPropagating property included on event object
    garrlker committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    f3ae9bb View commit details
    Browse the repository at this point in the history
  2. Merge branch '515-pointer-eventmanager-state' of github.com:Tresjs/tr…

    …es into 515-pointer-eventmanager-state
    garrlker committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    1677751 View commit details
    Browse the repository at this point in the history
  3. chore: lint

    garrlker committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    7aca715 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    496cd28 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. chore: fix lint issues

    alvarosabu committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    9981ad7 View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    be99065 View commit details
    Browse the repository at this point in the history