Woo, it's been a good week.
Given that I want to make some games in lisp I really wanted a physics engine. As usual I'm trying to keep things open source so I first looked at ODE.
Now the first part was to tackle some bugs in the bindings generator. Luckily after all my recent work I am super familiar with this stuff so that was no issue.
One Second. Look at this https://github.com/cffi/cffi/pulls?q=is%3Apr+is%3Aclosed . Im slowly getting my stuff in :)
Anyhoo back on the physics stuff. I got the library wrapped and started work on some higher level bindings. I got a whole bunch of stuff wrapped and after half a day made a simple example of a ball balling to bounce on a plane. Except that it didnt bounce, it just crashed :p
That sucked, but as imagined it was a bug on my part and it took me WAY to long to find. I just couldn't understand get over how I was getting the issue when my code was almost exactly like the c++ examples...Until I remembered that a stack allocated array in C is probably zero'd out and my stack allocated ffi array was not...woops! Lots of junk data in the fields was freaking out ODE. Well that was totally reasonable so I fixed it up and suddenly NO CRASH
But it doesn't hit the floor either..
Now the next part sucked. I spent 10 hours fucking with this and it was late sunday and the damn thing still wasn't working. All the forum topics agreed that I should be tweaking the various physical value properties of the object & floor but none agreed on even the fucking magnitude of those values. Seriously I say 2 posts from established members say that 'that value is not a good choice use ' and in 1 thread was 0.2 and in the other it was positive infinity :D
I was so disappointed at this point, it felt like a wasted weekend.
I managed to motivate myself to start on wrapping another open source phsyics engine called 'Newton Dynamics' just so I could get a feeling of how much of an arse that one was going to be.
Well 15 mins later I had raw bindings and an hour later I has it working! fuck me it was lovely, and SO STABLE. I threw 2 balls in a collisions with the floor an each other we just SOLID. I hooked it up to a CEPL example so I could render the result and man it was super satisfying. I havnet got a pick as it's just two spheres so makes for a crappy screenshot.. but it works!
So last night I hammered away at making some higher level bindings for Newton. I'm super stoked with how it's going and I'll definitely have a solid physics engine for my projects soon.
Other than that I have taken the code that got rejected from the FFI last week and turned it into it's own library. It's working great and I'm using it for another of my projects already. I'm getting it into the lisp package manager this month so that, after that, I can start shipping software that uses it.
I have users, and they are awesome!
One is using CEPL in a wayland compositor https://github.com/malcolmstill/ulubis
And the other is writing loads of docs for me which is possibly the nicest thing anyone can do for an open source project.
That's the lot, man I love coding.