Browse Source

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 tháng trước cách đây
mục cha
commit
b974f4a042
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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) {