pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.73k stars 312 forks source link

Fixed typescript output for models with animations #64

Closed Code47X closed 3 years ago

Code47X commented 3 years ago

I wanted to throw up a PR for the issue expressed in #60. It's a fairly small change, just typecasting the Group ref as Object3D for useAnimations when the types flag is present.

From my understanding Group and Object3D are essentially the same thing, and they seem to typecast back and forth without issue.

Just a note - I wasn't quite sure how to execute the code after making the change in this pr to test it, so it would probably be worth doing a quick test run before if you decide to merge it. I've been manually doing the typecast in own projects and haven't had any issues.

Ran as expected.