I’m writing a toy soft body/cloth GPU physics engine and some procedural generation experiments. For now I’ve been able to output mesh sequences to files.
I’d like to use Godot as a mesh loader/renderer for interactive previews. However, while I’m not a beginner to coding in C++, I am one to the Godot codebase. I’d appreciate any guidance or reading material, so that I may have a general direction of where to start. Many thanks.
I would look at the current physics engines implementations, godot physics and jolt, both in the 4.4 version of the repo.
If you want to make a complete replacement you will need to support all the existing physics bodies. But I’ve seen some plugins skip some and also define their own bodies.
A custom physics engine i think would be considered a “server” within the architecture. But i could be wrong about that, maybe the current physics server is just an abstraction interface and you can provide the core behaviors as long as you adhere to the api.
Rendering is similar in the sense that it has its own server.
The only down side is that you will need to incur the overhead of requesting the gpu physics states back to the cpu to be handed to the gpu again for rendering. But this could potentially be done all on the gpu with a shader. Depending on your goals.
Thanks for the reply. I’m not planning to replace the entire physics engine. I simply wish to modify the mesh in real time using external algorithms. So it should be simpler than redoing the whole thing.