M
Modular2mo ago
Helehex

Thermo

A Physics Engine written in Mojo.
30 Replies
Drakontas
Drakontas2mo ago
this is awesome! what do you use to render this onto a window?
Helehex
Helehex2mo ago
I'm using sdl bindings for rendering, here's a link to that project https://github.com/Ryul0rd/sdl-bindings
ModularBot
ModularBot2mo ago
Congrats @Ghostfire The Insatiable, you just advanced to level 18!
Helehex
Helehex2mo ago
Current features of the collision solver: - Multiple collision features per body - Multiple contacts per collision - Position normal constraints - Velocity normal constraints with elasticity - Velocity tangent constraints with friction - Circle, lines, points, (some ray and aabb) - Contact force caching for faster convergence - Only discrete right now i havent pushed the repo yet, I'm waiting on a few things like getting the sdl-bindings to work from a .mojopkg, making sure bodies can get deleted without leaking, etc.. It's meant for games rather than scientific purposes. The technical name might end up being thermojo, to avoid conflicts with any existing projects name thermo.
xentropy
xentropy2mo ago
That is sick
Helehex
Helehex2mo ago
On my todo list today: - being able to change the camera pivot - being able to remove bodies (and some unrelated things, so hopefully i get to everything) oh yeah, checking sdl-binding from .mojopkg aswell, to see if anythings change. i heard we might be able to get it working with a different method
Hammad Ali
Hammad Ali2mo ago
Wow, does it support custom gravitation fields yet?
Helehex
Helehex2mo ago
it supports global gravity, but i left off any restrictions, so you can have rotational gravity, and scaling gravity lol. no skewing We dont do that around here. local gravity would be a good thing to get to though I'm working on my geometric algebra generator right now, but i should probably move on pretty soon so i can get to the other things, removing bodies might take a little refactoring to avoid leaks. also, it's kinda tied to my game framework right now but it'll get better I'm onto my last thing for the day which is removing bodies
Helehex
Helehex2mo ago
ok.. i found a bug with my elasticity
Helehex
Helehex2mo ago
but at least bodies can get removed. It's still tied to my game framework, so in this case i just put some logic in their update loop which gives them a life span. ok one of my goals today was to fix the issues i noticed with elasticity acting a little wierd im pretty sure i fixed it
Helehex
Helehex2mo ago
Helehex
Helehex2mo ago
but now for elasticity = 1 since that was giving me wierd behaviour before
Helehex
Helehex2mo ago
one of the lines got stuck hehe The boxes are just 4 lines right now
Helehex
Helehex2mo ago
Also, setting mass and inertia to infinity works to make things static bodies, so thats a good sign. But i should still add some flags for doing it proper one of the primitives i like to support is variable width lines so I'll probably add that at some point
Jack Clayton
Jack Clayton2mo ago
This is awesome @Ghostfire The Insatiable is the repo where you're building this private at the moment?
Want results from more Discord servers?
Add your server