Browse Source

chore: clean up console logs on raycaster

alvarosabu 2 năm trước cách đây
mục cha
commit
f4f9fd4313
2 tập tin đã thay đổi với 8 bổ sung8 xóa
  1. 3 3
      docs/guide/index.md
  2. 5 5
      src/composables/useRaycaster/index.ts

+ 3 - 3
docs/guide/index.md

@@ -15,15 +15,15 @@ TresJS v2 is still in alpha stage, so expect breaking changes until the first st
 ::: code-group
 
 ```bash [npm]
-npm install three @tresjs/core@alpha
+npm install three @tresjs/core@beta
 ```
 
 ```bash [yarn]
-yarn add three @tresjs/core@alpha
+yarn add three @tresjs/core@beta
 ```
 
 ```bash [pnpm]
-pnpm add three @tresjs/core@alpha
+pnpm add three @tresjs/core@beta
 ```
 
 :::

+ 5 - 5
src/composables/useRaycaster/index.ts

@@ -36,11 +36,11 @@ export function useRaycaster(): UseRaycasterReturn {
   const raycaster = shallowRef(new Raycaster())
   const pointer = ref(new Vector2())
   const currentInstance = ref(null)
-  const tres = useTres()
-  console.log({ tres })
-  tres.setState('raycaster', raycaster.value)
-  tres.setState('pointer', pointer)
-  tres.setState('currentInstance', currentInstance)
+  const { setState } = useTres()
+
+  setState('raycaster', raycaster.value)
+  setState('pointer', pointer)
+  setState('currentInstance', currentInstance)
 
   function onPointerMove(event: MouseEvent) {
     pointer.value.x = (event.clientX / window.innerWidth) * 2 - 1