#Why physics engine gets bundled even though I dont use physics?
1 messages · Page 1 of 1 (latest)
Hello, this is on the roadmap to be changed and to only load/be included when you use any physics component / explictly install it. It's something we want to get rid of too
Haha, literarily same mistake I made when creating my homebrew exporter. It was a major pain to untangle physics engine from three 😎
It shouldnt be a major headache i hope since only few components use it directly. But there are some other things coming first in the version 3 (next week i think) and then we can work on some sort of plugin system / move the physics into their own package maybe. Not 100% sure yet what the best way is
Godspeed!
Only collider and rigidbody components know anything of it actually and they also just call one already abstracted layer. Just need to move it out or refactor to load lazily (in which case we could keep everything as is and if you start using physics sometime later it could load which would also be a nice option)
And obviously not bundle rapier with the engine then. All that is to be figured out 🙂
Do you have any link to your custom engine? Just curious.
Nope it's super crude
And thanks for asking. So far nobody asked actually haha but just today when updating the vanilly js sample it totally bothered me again how big the js file is mainly because of physics 😐
But I pack into three compatibilile JSON
which was a major pain to convert verticies and lightmaps still act weird very often
A custom json format? Or you serialize to threejs objects from json?
Three has its own json format, I made schema for that and serialize into it
Gltf was the right decision for us. You can put everything in extensions and load it in three or another tool that has gltf support.
Ah ok i see
It was 100%
The very first version we had heavily relied on js codegen as well. That wouldnt have scaled tho and now we can relatively easily build files that are kind of like a fully serialized scene (it could replace a complete unity scene asset at some point even with interop to blender for example. Its super cool)
Yup, I saw you also made monobeheaviour-lite that users can code up in TS
Super cool NGL
Haha monobehaviour light yeah kind of. With codegen to unity and blender for visual editing if you want 🙂
Its a bit confusing for people when first starting since it works the other way around (because you code in typescript) but has many benefits too 🙂
For people who are used to three I guess its super fine
Hi @idle vigil im curious how your experience is so far and if you did continue using our tools?
@hard bronze I probably dont use it enough to give a meaningful feedback.
- I was overwhelmed by number of files in generated project (I want to put this into my exisiting astro project, but tedious migration probably cant be avoided?)
- I am happy with scene that gets exported as gltf, maybe would be nice to have some way to quickly resize textures before its exported?
Hope you dont change the way gltf gets exported because as I start digging into it and adding scripts to control objects in scene any change would be a breaking change
- How is that project setup? You most likely dont have to use the generated files if you have a project already. Otherwise it would be a good test for us to see what's not yet working if you're willing to share a bit about that (can be via DM)
- You can use the Texture import settings in Unity to change max size (compression will be applied when you make a production build - but you can also trigger it manually via the ExportInfo context menu)
How do you mean that? We will not introduce any breaking changes there (nothing planned). How are you adding scripts? Are you just using the export capabilities and load it using your own engine or are you using Needle Engine for loading it too?
That's great. I have my own tiny engine running on top of three, written in typescript, that does similar things to needle, such as calling update and start method on components.
So for me its great that I can export entire scene and access all the exported objects in a predictable manner
As needle evolves and I understand better how to use it I probably wont need my own engine though
So godspeed to you guys 😎
Right now as I said prototyping with needle is out of question for me, since bundled physics engine is going to drastically affect load times
Hello @idle vigil I've got good news for you:
Will be available in one of the next updates
with rapier:
without rapier:
Thanks for pinging ❤️ Awesome!
You dropped this 👑
king of Three