this is just a quick experiment of trying to run 3D physics on pokitto with my new library tinyphysicsengine.
They’re not nice demos, I just wanted to see if it would run, in the future I’d probably like to make a game with this (probably some trackmania clone) but I’m a bit tired of programming and want to just share what I have so that you can play around.
Here I just tried a simple car driving demo and some colliding cubes with primitive rendering using small3dlib and SAF. It runs on interactive FPS, sometimes with the cubes I get a bit of tearing, though I didn’t extremely optimize the demo code, it’s not even overclocked, it can probably run faster. Also TPE is a soft body library which I think is slower than a rigid body, but I failed at making a simple rigid body engine, details are in the repo.
Is this even usable? Well, I think so but mostly in limited ways. Remember that with 3D physics you also want 3D rendering which will also eat up some CPU juice, plus you still have to leave something for the game logic. So you can only have very few bodies and make various simplifications. E.g. in a racing game you could have some simplified driving and only when you crash into something you’d turn on the full simulation so that during driving the game stays extra smooth. The library can also handle first person physics, some very primitive 2D physics, something aking a “cloth” physics etc., but remember, it’s an extremely simple library that mostly just FAKES physics and you have to handle many things yourself, it won’t just work. It approximates bodies only by spheres, for the environment you can in theory use any shape that you can describe with a distance function.
As always public domain CC0.
Pokitto sources and bins here.