Răsfoiți Sursa

refactor: update useLoop composable to replace raycaster with events

- Modified the `useLoop` composable to utilize `events` instead of `raycaster`, aligning with the recent changes in the Tres context structure.
- This change enhances the integration with the updated event system, ensuring better context handling during the rendering loop.
alvarosabu 3 luni în urmă
părinte
comite
b974f4a042
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      src/composables/useLoop/index.ts

+ 2 - 2
src/composables/useLoop/index.ts

@@ -7,8 +7,8 @@ export function useLoop() {
     scene,
     renderer,
     loop,
-    raycaster,
     controls,
+    events,
   } = useTresContext()
 
   // Pass context to loop
@@ -16,8 +16,8 @@ export function useLoop() {
     camera,
     scene,
     renderer: renderer.instance,
-    raycaster,
     controls,
+    events,
   })
 
   function onBeforeRender(cb: LoopCallbackFn, index = 0) {