Closed bjornstar closed 3 years ago
Alright, you have my vote for #242. :)
I'm happy with this PR now. All messages to the worker are typed and the API is consistently typed too. I will focus on converting the rest of the examples after this.
Hey, I noticed all instanceMesh
are broken, bodies within them don't render. :/
Hey, I noticed all
instanceMesh
are broken, bodies within them don't render. :/
Hmmm, I tested all the examples just now, KinematicCube & CubeHeap both rendered. Is there a specific one that's not rendering?
Nope, every example that implements instanceMesh
does not render its instances. Rather strange.
These are screenshots of Firefox, but the same is observable in other browsers.
It's a weird one, doesn't occur when installing dependencies with npm
. I have raised #260 it seems to fix the problem.
It should be fixed now, can you give it a try?
Fixed, thanks!
With this we will have types for all messages being sent to the worker.
Maybe someone who's better at TypeScript can figure out a way to write a replacement post function, but I couldn't figure it out.
Once again, I want to suggest merging #242 because the ground truth of the system is that
ref.current
is often null and we avoid posting messages to the worker when that happens. We should not just close our eyes and pretend like it always has a value.