Better HN
topnewbestaskshowjobs
Log inSign up

IainWinter

6 karma · joined Aug 1, 2020 (6y ago) · 5 submissions

Submissions

comment 6y ago · link · parent

That makes it so nothing explodes, and then there is a second solver that does a small raw position correction after. So it's not lifelike realism, but it works to stop objects sinking into each other too much. There is still a small error though, I'd have to look into more iterations and all that.

comment 6y ago · link · parent

One day... Once I understand what the hell a jacobian matrix is. I do want that stack of boxes :)

comment 6y ago · link · parent

Yeah it's up to the person using it to store them sensibly. I use an ECS so they are mostly all contiguous. I think that the pointer hurts the cache for the fist iterations, but once the whole array is cached I think the pointer becomes ok.

There is still that indirection though :(

comment 6y ago · link · parent

Yeah that's why I used spheres :)

I plan to make a part 2 that covers more complex constraint based methods. I'll put rotation in with that.

comment 6y ago · link · parent

Oh you're correct, I was trying to make the code more readable for the blog post and didn't even think of that! Thanks for the heads up I would of never caught that, and good info about different integrators, not going to pretend that I knew all of it. It makes sense though because the velocity used for the position would be a frame behind.

I was looking into the Runge-Kutta method, but it looked too complex for what I was doing.