瀏覽代碼

Merge branch 'main' into refactor/events

Alvaro Saburido 7 月之前
父節點
當前提交
6255cd6dc4

+ 8 - 0
CHANGELOG.md

@@ -1,4 +1,12 @@
+# Changelog
 
+## [4.3.3](https://github.com/Tresjs/tres/compare/4.3.2...4.3.3) (2025-02-06)
+
+### Bug Fixes
+
+* remove camera warning log on default camera creation ([#916](https://github.com/Tresjs/tres/issues/916)) ([5d490b4](https://github.com/Tresjs/tres/commit/5d490b4989ed68ff81569398d5b1fe8f09cddea0))
+* safely remove helpers in vDistanceTo and vLightHelper directives ([#919](https://github.com/Tresjs/tres/issues/919)) ([f512b1a](https://github.com/Tresjs/tres/commit/f512b1a129f3740337c813f3a9cd79355356e043))
+* typescript build issues utils ([#924](https://github.com/Tresjs/tres/issues/924)) ([e9b7bf9](https://github.com/Tresjs/tres/commit/e9b7bf97f7561aaa7dba9eae46954278a04ab017))
 
 ## [4.3.2](https://github.com/Tresjs/tres/compare/4.3.1...4.3.2) (2025-01-03)
 

+ 3 - 3
docs/package.json

@@ -14,9 +14,9 @@
   },
   "devDependencies": {
     "@iconify-json/logos": "^1.2.4",
-    "@iconify-json/mdi": "^1.2.2",
-    "unocss": "^0.65.2",
+    "@iconify-json/mdi": "^1.2.3",
+    "unocss": "^65.4.3",
     "vite-svg-loader": "^5.1.0",
-    "vitepress-plugin-group-icons": "^1.3.2"
+    "vitepress-plugin-group-icons": "^1.3.5"
   }
 }

+ 1 - 1
netlify.toml

@@ -3,4 +3,4 @@ publish = "docs/.vitepress/dist"
 command = "pnpm run build && pnpm docs:build"
 
 [build.environment]
-NODE_VERSION = "18"
+NODE_VERSION = "20"

+ 25 - 25
package.json

@@ -1,7 +1,7 @@
 {
   "name": "@tresjs/core",
   "type": "module",
-  "version": "4.3.2",
+  "version": "4.3.3",
   "packageManager": "pnpm@9.15.5",
   "description": "Declarative ThreeJS using Vue Components",
   "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
@@ -73,46 +73,46 @@
   "dependencies": {
     "@alvarosabu/utils": "^3.2.0",
     "@vue/devtools-api": "^6.6.3",
-    "@vueuse/core": "^12.0.0"
+    "@vueuse/core": "^12.5.0"
   },
   "devDependencies": {
-    "@release-it/conventional-changelog": "^9.0.3",
+    "@release-it/conventional-changelog": "^10.0.0",
     "@stackblitz/sdk": "^1.11.0",
-    "@tresjs/cientos": "4.0.3",
+    "@tresjs/cientos": "4.1.0",
     "@tresjs/eslint-config": "^1.4.0",
-    "@types/three": "^0.171.0",
-    "@typescript-eslint/eslint-plugin": "^8.18.1",
-    "@typescript-eslint/parser": "^8.18.1",
+    "@types/three": "^0.173.0",
+    "@typescript-eslint/eslint-plugin": "^8.23.0",
+    "@typescript-eslint/parser": "^8.23.0",
     "@vitejs/plugin-vue": "^5.2.1",
     "@vitest/coverage-c8": "^0.33.0",
-    "@vitest/coverage-v8": "^2.1.8",
-    "@vitest/ui": "^2.1.8",
+    "@vitest/coverage-v8": "^3.0.5",
+    "@vitest/ui": "^3.0.5",
     "@vue/test-utils": "^2.4.6",
-    "eslint": "^9.17.0",
+    "eslint": "^9.19.0",
     "eslint-plugin-vue": "^9.32.0",
     "esno": "^4.8.0",
-    "gsap": "^3.12.5",
-    "jsdom": "^25.0.1",
+    "gsap": "^3.12.7",
+    "jsdom": "^26.0.0",
     "kolorist": "^1.8.0",
     "ohmyfetch": "^0.4.21",
-    "pathe": "^1.1.2",
-    "release-it": "^17.10.0",
+    "pathe": "^2.0.2",
+    "release-it": "^18.1.2",
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.5.0",
-    "rollup-plugin-visualizer": "^5.12.0",
-    "sponsorkit": "^0.16.2",
-    "three": "^0.171.0",
-    "unocss": "^0.65.2",
-    "unplugin": "^2.1.0",
-    "unplugin-vue-components": "^0.28.0",
-    "vite": "^6.0.5",
+    "rollup-plugin-visualizer": "^5.14.0",
+    "sponsorkit": "^16.3.0",
+    "three": "^0.173.0",
+    "unocss": "^65.4.3",
+    "unplugin": "^2.1.2",
+    "unplugin-vue-components": "^28.0.0",
+    "vite": "^6.1.0",
     "vite-plugin-banner": "^0.8.0",
-    "vite-plugin-dts": "4.4.0",
-    "vite-plugin-inspect": "^0.10.4",
+    "vite-plugin-dts": "4.5.0",
+    "vite-plugin-inspect": "^10.1.0",
     "vite-plugin-require-transform": "^1.0.21",
     "vite-svg-loader": "^5.1.0",
-    "vitepress": "1.5.0",
-    "vitest": "2.1.8",
+    "vitepress": "1.6.3",
+    "vitest": "3.0.5",
     "vue": "3.5.13",
     "vue-demi": "^0.14.10"
   }

+ 5 - 5
playground/vue/package.json

@@ -9,17 +9,17 @@
     "preview": "vite preview"
   },
   "dependencies": {
-    "@tresjs/cientos": "4.0.3",
+    "@tresjs/cientos": "4.1.0",
     "@tresjs/core": "workspace:^",
     "@tresjs/leches": "https://pkg.pr.new/@tresjs/leches@9ad0cd3",
     "vue-router": "^4.5.0"
   },
   "devDependencies": {
     "@tweakpane/plugin-essentials": "^0.2.0",
-    "unplugin-auto-import": "^0.19.0",
+    "unplugin-auto-import": "^19.0.0",
     "vite-plugin-glsl": "^1.3.1",
-    "vite-plugin-qrcode": "^0.2.3",
-    "vite-plugin-vue-devtools": "7.6.8",
-    "vue-tsc": "^2.1.10"
+    "vite-plugin-qrcode": "^0.2.4",
+    "vite-plugin-vue-devtools": "7.7.1",
+    "vue-tsc": "^2.2.0"
   }
 }

File diff suppressed because it is too large
+ 410 - 226
pnpm-lock.yaml


+ 1 - 0
src/composables/useTresReady/createReadyEventHook/index.ts

@@ -81,6 +81,7 @@ export function createReadyEventHook<T>(
     on: onOrCall,
     off: hook.off,
     trigger: hook.trigger,
+    clear: hook.clear,
     cancel,
   }
 }

+ 22 - 16
src/devtools/plugin.ts

@@ -187,23 +187,29 @@ export function registerTresDevtools(app: DevtoolsApp, tres: TresContext) {
           }
 
           if (instance.isScene) {
-            payload.state.info = {
-              objects: instance.children.length,
-              memory: calculateMemoryUsage(instance),
-              calls: tres.renderer.value.info.render.calls,
-              triangles: tres.renderer.value.info.render.triangles,
-              points: tres.renderer.value.info.render.points,
-              lines: tres.renderer.value.info.render.lines,
+            payload.state = {
+              ...payload.state,
+              state: [
+                {
+                  key: 'Scene Info',
+                  value: {
+                    objects: instance.children.length,
+                    memory: calculateMemoryUsage(instance),
+                    calls: tres.renderer.value.info.render.calls,
+                    triangles: tres.renderer.value.info.render.triangles,
+                    points: tres.renderer.value.info.render.points,
+                    lines: tres.renderer.value.info.render.lines,
+                  },
+                },
+                {
+                  key: 'Programs',
+                  value: tres.renderer.value.info.programs?.map(program => ({
+                    ...program,
+                    programName: program.name,
+                  })) || [],
+                },
+              ],
             }
-            payload.state.programs = tres.renderer.value.info.programs?.map(program => ({
-              key: program.name,
-              value: {
-                ...program,
-                vertexShader: program.vertexShader,
-                attributes: program.getAttributes(),
-                uniforms: program.getUniforms(),
-              },
-            })) || []
           }
         }
       })

+ 1 - 4
src/utils/index.ts

@@ -294,7 +294,7 @@ export function disposeObject3D(object: TresObject): void {
   children.forEach(child => disposeObject3D(child))
 
   if (object instanceof Scene) {
-    // Optionally handle Scene-specific cleanup
+    // TODO: Handle Scene-specific cleanup
   }
   else {
     const mesh = object as unknown as Partial<Mesh>
@@ -303,16 +303,13 @@ export function disposeObject3D(object: TresObject): void {
     }
     if (mesh.geometry) {
       mesh.geometry.dispose()
-      delete mesh.geometry
     }
 
     if (Array.isArray(mesh.material)) {
       mesh.material.forEach(material => disposeMaterial(material))
-      delete mesh.material
     }
     else if (mesh.material) {
       disposeMaterial(mesh.material)
-      delete mesh.material
     }
   }
 }

+ 119 - 278
src/utils/is.test.ts

@@ -1,285 +1,126 @@
-import { BufferGeometry, Fog, MeshBasicMaterial, MeshNormalMaterial, Object3D, PerspectiveCamera } from 'three'
+import type { Camera, Light, Material, Object3D } from 'three'
+import { AmbientLight, BufferGeometry, DirectionalLight, Fog, Group, Mesh, MeshBasicMaterial, MeshNormalMaterial, OrthographicCamera, PerspectiveCamera, PointLight, Scene } from 'three'
 import * as is from './is'
 
-describe('is', () => {
-  describe('is.num(a: any)', () => {
-    describe('true', () => {
-      it('number', () => {
-        assert(is.num(0))
-        assert(is.num(-1))
-        assert(is.num(Math.PI))
-        assert(is.num(Number.POSITIVE_INFINITY))
-        assert(is.num(Number.NEGATIVE_INFINITY))
-        assert(is.num(42))
-        assert(is.num(0b1111))
-        assert(is.num(0o17))
-        assert(is.num(0xF))
-      })
-    })
-    describe('false', () => {
-      it('null', () => {
-        assert(!is.num(null))
-      })
-      it('undefined', () => {
-        assert(!is.num(undefined))
-      })
-      it('string', () => {
-        assert(!is.num(''))
-        assert(!is.num('1'))
-      })
-      it('function', () => {
-        assert(!is.num(() => {}))
-        assert(!is.num(() => 1))
-      })
-      it('array', () => {
-        assert(!is.num([]))
-        assert(!is.num([1]))
-      })
-    })
-  })
-  describe('is.und(a: any)', () => {
-    describe('true', () => {
-      it('undefined', () => {
-        assert(is.und(undefined))
-      })
-    })
-    describe('false', () => {
-      it('null', () => {
-        assert(!is.und(null))
-      })
-      it('number', () => {
-        assert(!is.und(0))
-        assert(!is.und(-1))
-        assert(!is.und(Math.PI))
-        assert(!is.und(Number.POSITIVE_INFINITY))
-        assert(!is.und(Number.NEGATIVE_INFINITY))
-        assert(!is.und(42))
-      })
-      it('string', () => {
-        assert(!is.und(''))
-        assert(!is.und('tresObject'))
-      })
-      it('function', () => {
-        assert(!is.und(() => {}))
-      })
-      it('array', () => {
-        assert(!is.und([]))
-      })
-    })
-  })
-  describe('is.tresObject(a: any)', () => {
-    describe('true', () => {
-      it('object3D', () => {
-        assert(is.tresObject(new Object3D()))
-      })
-      it('bufferGeometry', () => {
-        assert(is.tresObject(new BufferGeometry()))
-      })
-      it('material', () => {
-        assert(is.tresObject(new MeshNormalMaterial()))
-      })
-      it('fog', () => {
-        assert(is.tresObject(new Fog('red')))
-      })
-      it('camera', () => {
-        assert(is.tresObject(new PerspectiveCamera()))
-      })
-    })
-    describe('false', () => {
-      it('undefined', () => {
-        assert(!is.tresObject(undefined))
-      })
-      it('null', () => {
-        assert(!is.tresObject(null))
-      })
-      it('number', () => {
-        assert(!is.tresObject(0))
-        assert(!is.tresObject(Math.PI))
-        assert(!is.tresObject(Number.POSITIVE_INFINITY))
-        assert(!is.tresObject(Number.NEGATIVE_INFINITY))
-        assert(!is.tresObject(42))
-      })
-      it('string', () => {
-        assert(!is.tresObject(''))
-        assert(!is.tresObject('tresObject'))
-      })
-      it('function', () => {
-        assert(!is.tresObject(() => {}))
-        assert(!is.tresObject(() => {}))
-      })
-    })
-  })
+const NUMBERS: Record<string, number> = {
+  '0': 0,
+  '1': 1,
+  '-1': -1,
+  '42': 42,
+  'Math.PI': Math.PI,
+  '-inf': Number.NEGATIVE_INFINITY,
+  '+inf': Number.POSITIVE_INFINITY,
+  '0b1111': 0b1111,
+  '0o17': 0o17,
+  '0xF': 0xF,
+}
 
-  describe('is.bufferGeometry(a: any)', () => {
-    describe('true', () => {
-      it('bufferGeometry', () => {
-        assert(is.bufferGeometry(new BufferGeometry()))
-      })
-    })
-    describe('false', () => {
-      it('object3D', () => {
-        assert(!is.bufferGeometry(new Object3D()))
-      })
-      it('material', () => {
-        assert(!is.bufferGeometry(new MeshNormalMaterial()))
-      })
-      it('fog', () => {
-        assert(!is.bufferGeometry(new Fog('red')))
-      })
-      it('camera', () => {
-        assert(!is.bufferGeometry(new PerspectiveCamera()))
-      })
-      it('undefined', () => {
-        assert(!is.bufferGeometry(undefined))
-      })
-      it('null', () => {
-        assert(!is.bufferGeometry(null))
-      })
-      it('number', () => {
-        assert(!is.bufferGeometry(0))
-        assert(!is.bufferGeometry(Math.PI))
-        assert(!is.bufferGeometry(Number.POSITIVE_INFINITY))
-        assert(!is.bufferGeometry(Number.NEGATIVE_INFINITY))
-        assert(!is.bufferGeometry(42))
-      })
-      it('string', () => {
-        assert(!is.bufferGeometry(''))
-        assert(!is.bufferGeometry('bufferGeometry'))
-      })
-      it('function', () => {
-        assert(!is.bufferGeometry(() => {}))
-        assert(!is.bufferGeometry(() => {}))
-      })
-    })
-  })
+const BOOLEANS: Record<string, boolean> = {
+  true: true,
+  false: false,
+}
 
-  describe('is.material(a: any)', () => {
-    describe('true', () => {
-      it('material', () => {
-        assert(is.material(new MeshNormalMaterial()))
-        assert(is.material(new MeshBasicMaterial()))
-      })
-    })
-    describe('false', () => {
-      it('object3D', () => {
-        assert(!is.bufferGeometry(new Object3D()))
-      })
-      it('bufferGeometry', () => {
-        assert(!is.bufferGeometry(new MeshNormalMaterial()))
-      })
-      it('fog', () => {
-        assert(!is.bufferGeometry(new Fog('red')))
-      })
-      it('camera', () => {
-        assert(!is.bufferGeometry(new PerspectiveCamera()))
-      })
-      it('undefined', () => {
-        assert(!is.bufferGeometry(undefined))
-      })
-      it('null', () => {
-        assert(!is.bufferGeometry(null))
-      })
-      it('number', () => {
-        assert(!is.bufferGeometry(0))
-        assert(!is.bufferGeometry(Math.PI))
-        assert(!is.bufferGeometry(Number.POSITIVE_INFINITY))
-        assert(!is.bufferGeometry(Number.NEGATIVE_INFINITY))
-        assert(!is.bufferGeometry(42))
-      })
-      it('string', () => {
-        assert(!is.bufferGeometry(''))
-        assert(!is.bufferGeometry('bufferGeometry'))
-      })
-      it('function', () => {
-        assert(!is.bufferGeometry(() => {}))
-        assert(!is.bufferGeometry(() => {}))
-      })
-    })
-  })
+const STRINGS: Record<string, string> = {
+  a: 'a',
+  aa: 'aa',
+  stringEmpty: '',
+  stringNumber: '0',
+}
 
-  describe('is.camera(a: any)', () => {
-    describe('true', () => {
-      it('camera', () => {
-        assert(is.camera(new PerspectiveCamera()))
-      })
-    })
-    describe('false', () => {
-      it('object3D', () => {
-        assert(!is.camera(new Object3D()))
-      })
-      it('bufferGeometry', () => {
-        assert(!is.camera(new BufferGeometry()))
-      })
-      it('material', () => {
-        assert(!is.camera(new MeshNormalMaterial()))
-      })
-      it('fog', () => {
-        assert(!is.camera(new Fog('red')))
-      })
-      it('undefined', () => {
-        assert(!is.camera(undefined))
-      })
-      it('null', () => {
-        assert(!is.camera(null))
-      })
-      it('number', () => {
-        assert(!is.camera(0))
-        assert(!is.camera(Math.PI))
-        assert(!is.camera(Number.POSITIVE_INFINITY))
-        assert(!is.camera(Number.NEGATIVE_INFINITY))
-        assert(!is.camera(42))
-      })
-      it('string', () => {
-        assert(!is.camera(''))
-        assert(!is.camera('camera'))
-      })
-      it('function', () => {
-        assert(!is.camera(() => {}))
-        assert(!is.camera(() => {}))
-      })
-    })
-  })
+const NULL: Record<string, null> = {
+  null: null,
+}
 
-  describe('is.fog(a: any)', () => {
-    describe('true', () => {
-      it('fog', () => {
-        assert(is.fog(new Fog('red')))
-      })
-    })
-    describe('false', () => {
-      it('object3D', () => {
-        assert(!is.fog(new Object3D()))
-      })
-      it('camera', () => {
-        assert(!is.fog(new PerspectiveCamera()))
-      })
-      it('bufferGeometry', () => {
-        assert(!is.fog(new BufferGeometry()))
-      })
-      it('material', () => {
-        assert(!is.fog(new MeshNormalMaterial()))
-      })
-      it('undefined', () => {
-        assert(!is.fog(undefined))
-      })
-      it('null', () => {
-        assert(!is.fog(null))
-      })
-      it('number', () => {
-        assert(!is.fog(0))
-        assert(!is.fog(Math.PI))
-        assert(!is.fog(Number.POSITIVE_INFINITY))
-        assert(!is.fog(Number.NEGATIVE_INFINITY))
-        assert(!is.fog(42))
-      })
-      it('string', () => {
-        assert(!is.fog(''))
-        assert(!is.fog('camera'))
-      })
-      it('function', () => {
-        assert(!is.fog(() => {}))
-        assert(!is.fog(() => {}))
-      })
-    })
-  })
+const UNDEFINED: Record<string, undefined> = {
+  undefined,
+}
+
+const ARRAYS: Record<string, any[]> = {
+  arrayEmpty: [],
+  arrayZero: [0],
+  arrayString: ['a'],
+  arrayMixed: ['', 0, undefined],
+}
+
+const FUNCTIONS: Record<string, (...a: any) => any> = {
+  functionVoid: () => {},
+  functionUndefined: () => undefined,
+  functionNull: () => null,
+  functionString: () => 'a',
+  functionZero: () => 0,
+}
+
+const FOGS: Record<string, Fog> = {
+  fogRed: new Fog('red'),
+  fogBlue: new Fog('blue'),
+}
+
+const MATERIALS: Record<string, Material> = {
+  meshNormalMaterial: new MeshNormalMaterial(),
+  meshBasicMaterial: new MeshBasicMaterial(),
+}
+
+const CAMERAS: Record<string, Camera> = {
+  perspectiveCamera: new PerspectiveCamera(),
+  orthographicCamera: new OrthographicCamera(),
+}
+
+const SCENES: Record<string, Scene> = {
+  scene: new Scene(),
+}
+
+const LIGHTS: Record<string, Light> = {
+  pointLight: new PointLight(),
+  directionalLight: new DirectionalLight(),
+  ambientLight: new AmbientLight(),
+}
+
+const OBJECT3DS: Record<string, Object3D> = {
+  mesh: new Mesh(),
+  group: new Group(),
+  ...SCENES,
+  ...LIGHTS,
+  ...CAMERAS,
+}
+
+const BUFFER_GEOMETRIES: Record<string, BufferGeometry> = {
+  bufferGeometry: new BufferGeometry(),
+}
+
+const OBJECTS = Object.assign({}, { '{}': {}, '{ a: "a" }': { a: 'a' } }, FOGS, MATERIALS, OBJECT3DS, BUFFER_GEOMETRIES)
+
+// NOTE: See definition in is.ts
+const TRES_OBJECTS = Object.assign({}, MATERIALS, OBJECT3DS, BUFFER_GEOMETRIES, FOGS)
+
+const ALL = Object.assign({}, NUMBERS, BOOLEANS, STRINGS, NULL, UNDEFINED, ARRAYS, FUNCTIONS, OBJECTS)
+
+describe('is', () => {
+  describe('is.und(a: any)', () => { test(is.und, UNDEFINED) })
+  describe('is.arr(a: any)', () => { test(is.arr, ARRAYS) })
+  describe('is.num(a: any)', () => { test(is.num, NUMBERS) })
+  describe('is.str(a: any)', () => { test(is.str, STRINGS) })
+  describe('is.bool(a: any)', () => { test(is.bool, BOOLEANS) })
+  describe('is.fun(a: any)', () => { test(is.fun, FUNCTIONS) })
+  describe('is.obj(a: any)', () => { test(is.obj, OBJECTS) })
+  describe('is.object3D(a: any)', () => { test(is.object3D, OBJECT3DS) })
+  describe('is.camera(a: any)', () => { test(is.camera, CAMERAS) })
+  describe('is.bufferGeometry(a: any)', () => { test(is.bufferGeometry, BUFFER_GEOMETRIES) })
+  describe('is.material(a: any)', () => { test(is.material, MATERIALS) })
+  describe('is.light(a: any)', () => { test(is.light, LIGHTS) })
+  describe('is.fog(a: any)', () => { test(is.fog, FOGS) })
+  describe('is.scene(a: any)', () => { test(is.scene, SCENES) })
+  describe('is.tresObject(a: any)', () => { test(is.tresObject, TRES_OBJECTS) })
 })
+
+/**
+ * Test all values in `ALL`.
+ * `fn` should return `true` for all values in `truth` else `false`.
+ */
+function test(fn: (a: any) => boolean, truth: Record<string, any>) {
+  const trueKeys = new Set(Object.keys(truth))
+  for (const [key, value] of Object.entries(ALL)) {
+    it(`returns ${trueKeys.has(key)} for ${key}`, () => {
+      expect(fn(value)).toBe(trueKeys.has(key))
+    })
+  }
+}

+ 9 - 9
src/utils/is.ts

@@ -1,11 +1,11 @@
 import type { TresObject, TresPrimitive } from 'src/types'
 import type { BufferGeometry, Camera, Fog, Light, Material, Object3D, Scene } from 'three'
 
-export function und(u: unknown) {
+export function und(u: unknown): u is undefined {
   return typeof u === 'undefined'
 }
 
-export function arr(u: unknown) {
+export function arr(u: unknown): u is Array<unknown> {
   return Array.isArray(u)
 }
 
@@ -30,31 +30,31 @@ export function obj(u: unknown): u is Record<string | number | symbol, unknown>
 }
 
 export function object3D(u: unknown): u is Object3D {
-  return obj(u) && ('isObject3D' in u) && !!(u.isObject3D)
+  return obj(u) && !!(u.isObject3D)
 }
 
 export function camera(u: unknown): u is Camera {
-  return obj(u) && 'isCamera' in u && !!(u.isCamera)
+  return obj(u) && !!(u.isCamera)
 }
 
 export function bufferGeometry(u: unknown): u is BufferGeometry {
-  return obj(u) && 'isBufferGeometry' in u && !!(u.isBufferGeometry)
+  return obj(u) && !!(u.isBufferGeometry)
 }
 
 export function material(u: unknown): u is Material {
-  return obj(u) && 'isMaterial' in u && !!(u.isMaterial)
+  return obj(u) && !!(u.isMaterial)
 }
 
 export function light(u: unknown): u is Light {
-  return obj(u) && 'isLight' in u && !!(u.isLight)
+  return obj(u) && !!(u.isLight)
 }
 
 export function fog(u: unknown): u is Fog {
-  return obj(u) && 'isFog' in u && !!(u.isFog)
+  return obj(u) && !!(u.isFog)
 }
 
 export function scene(u: unknown): u is Scene {
-  return obj(u) && 'isScene' in u && !!(u.isScene)
+  return obj(u) && !!(u.isScene)
 }
 
 export function tresObject(u: unknown): u is TresObject {

+ 1 - 1
src/utils/primitive/createRetargetingProxy.ts

@@ -1,7 +1,7 @@
 export function createRetargetingProxy<T extends Record<string | number | symbol, any>, K extends keyof T & string & symbol>(
   target: T,
   getters = {} as Record<string | number | symbol, (t: T) => unknown>,
-  setters = {} as Partial<Record<K, (val: T[K], t: T, proxy: T, setTarget: (newTarget: T) => void) => boolean>>,
+  setters = {} as Record<K, (val: T[K], t: T, proxy: T, setTarget: (newTarget: T) => void) => boolean>,
 ) {
   let _target = target
 

Some files were not shown because too many files changed in this diff