Closed RigoTamas closed 11 months ago
Hi @RigoTamas, are you getting a specific error in a project?
The scene
property is a Transform[]
, for reference in the Load GLTF example you can see how it's expected to be an array:
https://github.com/oframe/ogl/blob/32f7ec27c4ef528d8373a1719162aed2c0be0ae0/examples/load-gltf.html#L441-L449
Your first definition with scenes: Transform[][];
would be the correct one, good catch, I'll create a PR for that!
Thanks for getting onto this issue so fast. I am not getting any errors in my project. I just wanted to add TypeScript to my project, and that's when I've found out that there is something off about this type definition.
The type definition for the GLTF interface seems to be inaccurate. Both the
scene
andscenes
properties have type of:Transform[]
. The JS source code however hints thatscene
is an index shallower thanscenes
, becausescene
is created by indexing intoscenes
. So the correct typing should be either this:Or this: