Hi!
I have a project in Typescript (Angular) that load a simple gltf.
Everything works fine except when I try to use of RoughnessMipmapper, by traversing the gltf’s scene.
Does anyone have an idea?
although ‘child’ is a THREE.Object3D…
Hi!
I have a project in Typescript (Angular) that load a simple gltf.
Everything works fine except when I try to use of RoughnessMipmapper, by traversing the gltf’s scene.
Does anyone have an idea?
although ‘child’ is a THREE.Object3D…
Unfortunately, three.js’ isFoo
properties are difficult to use with TypeScript, just due to the nature of the type checking. Two workarounds you could use:
if ((child as Mesh).isMesh) { ... }
if (child instanceof Mesh) { ... }
For certain classes instanceof
is not helpful (e.g. InterleavedBufferAttribute is not a subclass of BufferAttribute) but for this case it’s fine.
It works
Thanks a lot @donmccurdy
ok my bad…
it has to be : this.controls.target